When moving to <Link>, LOCATION_CHANGE is called twice.
joyfuI opened this issue · 4 comments
joyfuI commented
I am migrating a project that used react-router-redux to connected-react-router.
Looking through the console logs, I noticed that LOCATION_CHANGE was being called twice every time a page was navigated.
Here is the reproduction code.
https://codesandbox.io/s/connected-react-router-0tbdu
Is this the correct behavior?
Akiyamka commented
I see the same behavior (twice LOCATION_CHANGE) even when dispatch the push action.
Relative issue: #318
joyfuI commented
I found the cause. StrictMode is the cause.
After further searching, I found the following article:
https://reactjs.org/docs/strict-mode.html#detecting-unexpected-side-effects
It's probably caused by two renderings in development mode with StrictMode.