ctrlplusb / react-async-component

Resolve components asynchronously, with support for code splitting and advanced server side rendering use cases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No-match routes rendered during async loading

rhyek opened this issue · comments

With a route configuration such as:

<Route path="/one" component={AsyncComponentOne} />
<Route path="/two" component={AsyncComponentTwo} />
<Route component={NoMatch} />

NoMatch will show while the async components are loading. Any way around this?

Nevermind! I'm an idiot and forgot to use <Switch>, so I was always getting the NoMatch rendered no matter what.