-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Issue with router and InfiniteScroll #295
Comments
Does this happen with |
With hash location we push Maybe we should be able to do this w/o causing two renders. |
The two-render problem is one that a lot of people have asked about and I've answered the question several times. I'm going to explain the mechanics of it here once more, and then remember this issue # to point people to it who ask about it in the future ;) When you call
Honestly, I've never understood why this is such a problem for people. One of the expectations of @Difort The infinite scroll script that you're using uses the @rpflorence If we did want to make the router only render once on initial page load, we could do one of 2 things:
Since neither of these are very good options, and since |
Maybe worthwhile to add a FAQ page to the docs and pull out gems such as this ^^^ and include it there so that people don't have to dig through closed issues to find helpful information and explanations? |
Yeah, we need an FAQ. |
So this happened to me, turns out the second willTransitionTo() did a redirect but the first one didn't, yet the second one's redirect never took effect. I think I will just add code to make it ignore the second willTransitionTo()... |
I am facing this similar issue and causing browser back button issue eg. I am navigating from View page (http://localhost:3000/) to Edit page (http://localhost:3000/editCard/1234) via dispatch(routeActions.push(/editCard/1234)), so it first navigate it to http://localhost:3000/editCard/panGuid1# and then http://localhost:3000/editCard/1234, when the user clicks browser back button. The page are navigating from the below sequence. http://localhost:3000/editCard/1234 Expected behaviour should be http://localhost:3000/editCard/1234 -> http://localhost:3000/ is there any fix for this? |
Any updates on my above question? |
I am not sure if this is the proper place to write this but here you go. I am using the infinite scrolling component from https://github.com/vjeux/react-infinite-scroll/blob/master/src/react-infinite-scroll.js
When I use react-router and I write the url of my website like: http://xxx.index.html, the react-router is changing it to http://xxx.index.html#/ and this is making that the function "loadMore" from InfiniteScroll component gets called twice! (so I am fetching twice from my server).
Instead, if I write the url as http://xxx.index.html#/ directly, it works fine. Any idea of why this is happening and how to solve it?
The text was updated successfully, but these errors were encountered: