Clear page when transitioning to same route.
See original GitHub issueSo I have these routes
var routes = (
<Route handler={App}>
<Route name="login" handler={Login}/>
<Route name="logout" handler={Logout}/>
<Route name="dashboard" path="/" handler={Dashboard} />
<Route name="user" path="/users/:id" handler={ShowUser} />
</Route>
);
I use the Link component to transfer between Dashboard and ShowUser which works fine. When I go from one User to another User(ie: users/1 to users/5) from the users page, the page doesn’t re render the way I would suspect. I’ve tried using componentWillRecieveProps but it doesn’t seem to re render everything. Plus I get Uncaught Error: Invariant Violation: processUpdates().
Is there a way to blow out the page and load the page like I was coming from another route? Thanks!
Edit: I solved this by using an isLoaded state and render the main page entry point when that’s set. I still would like to hear any comments about this. Thanks!
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Clear page when transitioning to same route. #572 - GitHub
I use the Link component to transfer between Dashboard and ShowUser which works fine. When I go from one User to another User(ie:...
Read more >Ember - Transition to same route with same model
Save this question. Show activity on this post. I have a left tree list, and each item in the list opens same route...
Read more >Apply and clear page transitions in InDesign - Adobe Support
In the Pages panel, select the spread from which you want to clear the transition, and then choose None from the Transition menu...
Read more >How to create page transitions with React Router - YouTube
Learn how to create page transitions with React and React Router.Have you ever tried to create page transitions with React?
Read more >Router tutorial: tour of heroes - Angular
This guide describes development of a multi-page routed sample application. Along the way, it highlights key features of the router such as: Organizing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@VinSpee @drewhamlett
You should handle it in
componentWillReceiveProps
in your handlers.@VinSpee
Minimizing state is good but you can have
componentWillReceiveProps
as I suggested in the component that hascurrentUser
in state already.Kind of like this. In your case,
Does this make sense?