New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug with <Switch/> in beta.7? #4661
Comments
It looks like |
It looks like I do need
If this is the canonical way to solve my problem, feel free to close this issue. I was under the impression that I suffered from However I'm surprised that writing my example this way results in
|
If your <Route path='/quux' render={() => <Lazy key='quux' fetch={...}/> }/> |
Thanks for the response @pshrmn |
@pshrmn Thanks. This works. But it works a little bit unexpected for me. I don't want to sound bad - you all do a great job - but this seems somewhat tedious to me. Inside But anyway, thank you. |
For example, I created a |
Cool, thank you for the link and your support! ❤ |
Version
4.0.0-beta.7
Test Case
I use webpack and react-router for code splitting and lazy loading parts of my page. My component to lazy load looks like this.
And I use it like this:
This worked in beta.6 and it works in beta.7 without
<Switch/>
around my<Route/>
's. I thought it was a problem withblocked-updates.md
, because only the first route which lazy loads a component is displayed correctly. Navigation through my app doesn't update correctly. But therender
method of my<Lazy/>
component is always called correctly and no matter how I force updating with passinglocation
through props, it doesn't work (becauserender
is called anyway...). It looks more like<Switch/>
doesn't display the the newly rendered part.Strange enough... it works when I use
<Lazy/>
just once:And it of course it works without it:
But this fails:
As well as this:
Or even this nightmare 😄:
The text was updated successfully, but these errors were encountered: