menu
up-caret
down-caret

Reach

Accessible React

# General

General Chatter

Trending conversations
Google Analytics
@hellojere · 3d
React Suspense + lazy over Parcel.js
@david-gomez · 42d
Setting basepath="/path" in the Router doesn't do anything..
@oooooooooooooooooooo · 7d
How to use dialog with react-pose?
@darkeye · 36d
How to inspect the inside of the MenuList?
@jmarantz · 5d

React.lazy + Suspense and Router cause errors.

Reach/General · November 4, 2018 at 9:28pm

React.lazy + Suspense and Router cause errors.

November 4, 2018 at 9:28pm (Edited 5 months ago)

I tried to combine suspense with react.lazy in react 16 with router, and it looks like router is crashed.

Reproduction example: https://codesandbox.io/s/2vk1y3olr0


November 5, 2018 at 1:33pm

The problem is Router is expecting the children to be a child with path. I've fixed your example here. https://codesandbox.io/s/7vw89z5l0

  • reply
  • like

Many thanks!

  • reply
  • like

January 20, 2019 at 5:19pm

Ryan Florence answered this question in this tweet: https://twitter.com/ryanflorence/status/1066390371318427648

  • reply
  • like