Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

only update on location changes #269

Closed
wants to merge 1 commit into from

Conversation

autarc
Copy link

@autarc autarc commented Feb 11, 2016

Currently a replace action is forced on any store dispatch at the initial route. Aside of polluting the log its also a problem in case history.listenBefore is used asynchronously. It triggers the listeners although the route didn't change.

@timdorr
Copy link
Member

timdorr commented Feb 11, 2016

Can you write up a small test to accompany this? Or do you have a use case I can look at?

@autarc
Copy link
Author

autarc commented Feb 12, 2016

Checked if writing a test would be reasonable, but ended with renaming the existing handles toggle after store change into handles toggle after routing store change which seems redundant. The issue is that each time the store gets updated the replace action is triggered even at the initial page, not only when there is an actual change towards routing but whenever an action gets dispatched.

This leads to errors regarding beforeListen((location, callback => ...) which will be triggered multiple times if an action is dispatched to set data for the next page. You can find here an example with asynchronous fetching at the client.

react-router-redux-keepinitiallocation

@svrcekmichal
Copy link
Contributor

@autarc Have you looked at #268 ? I was having the same issue, it was fixed in new version.

@timdorr timdorr added the bug label Feb 17, 2016
@timdorr
Copy link
Member

timdorr commented Feb 17, 2016

This is going to be superseded by 4.0.0, so I would upgrade to the rc.1 release and see if that works better for you. If not, open an issue on that version and we'll see about getting it fixed.

@timdorr timdorr closed this Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants