raphael-magalhaes / endeavour-frontend

1 stars 0 forks source link

Add React Router Redux & HMR #26

Open raphael-magalhaes opened 6 years ago

raphael-magalhaes commented 6 years ago

Since this project aims to be fully time travel ready, the React Router routes must be tracked somehow in the Redux Store. The React Router site provides a deep integration with Redux, so lets try to use it.

Regarding Hot Module Replacement (HMR), it can boost development productivity and make the whole Redux thang a lot more cooler (in a nutshell, it's the app that reload, instead of the browser, after changes occurs in the code, also you may not lose the redux state after making a change in the code, pure magic!).

After some digging about how to use HMR with CRA + Redux, I found an issue where Gaearon replies with a solution as described here, after trying it out, it worked. 😀

So here goes the steps of what to do:

raphael-magalhaes commented 6 years ago

Looks like the React Router Redux currently does not work with Chrome Redux DevTools:

So, for now, we wait. 👀

raphael-magalhaes commented 6 years ago

As the user Armour suggested, the connected-react-router can work with time travel. When react-router-redux adds/fixes this feature I will switch back to react-router-redux.

raphael-magalhaes commented 6 years ago

Here is more info on how to add HMR.