Closed nodkz closed 8 years ago
This actually seems to be an issue with the behavior of the babel hot module replacement plugin, as it is implemented and behaves as it should. I'm going to close this comment out for now, unless I'm misunderstanding the issue, then please let me know.
Firstly I run vanilla app, and click 5 times on the HOME icon.![react-universal-hmr-3](https://cloud.githubusercontent.com/assets/1946920/10695473/ad61c00a-79c5-11e5-839a-9aa72013a339.png)
After that I open
/app/reducers/app.js
and change code:HMR works, and produce![react-universal-hmr-4](https://cloud.githubusercontent.com/assets/1946920/10695536/f557c7ce-79c5-11e5-83d4-9b66dbe0f136.png)
I expect that counter does not change its value. And stays as 5. And if i click on the home icon it became 105, 205, etc.. But it became equal to 500.
How I understood, HMR has reinit state from scratch and replays all actions. But it is not good. Imagine, that we work with some DB, and some actions change data in DB. And if HMR replays actions from initial state it can get error from DB (record already exists, or record not found, because it was changed by actions at first time).
In such way, HMR does not give us ability to continue work with existed app state.