erikras / erikras/react-redux-universal-hot-example
ReduxAsyncConnect fires in Client Side when it shouldn't
- Dominant language
- JavaScript
- Stars
- 12.1k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
While using boilerplate i found some problem.
In reduxAsyncConnect I'm using getData() from my reducer, which loads some info from db. Later, I have a button, that changes one of returned values, but the value remain unchanged for the first time. Clicking second, third, etc. time it works perfectly correct. I think that I found where the problem is - clicking on button, which fires another function from reducer, trigggers some other actions - including "@@router/UPDATE_LOCATION", "reduxAsyncConnect/BEGIN_GLOBAL_LOAD" and "reduxAsyncConnect/END_GLOBAL_LOAD". Also it fires my action that is in reduxAsyncConnect, which causes reseting my reducer to initial state.
It can be checked even on clean boilerplate - all you need to do is to add console.log(action.type) in, for example redux/modules/widget.js and clicking in counter button on home page, shows all these actions, which shouldn't fire on clicking button!
One more info I found - such thing happens only if it's first action we do on page that was loaded from ssr. If we change page and return to home, none of previous functions is firing on clicking button.
Contributor guide
Assessment
This issue has not been assessed yet.