Upgrading react-redux 1 to 2
Breaking1.0.1 → 2.1.2Breaking2Platform1New1Fixed1
BreakingUpgrade verdict
2 breaking changes and a platform requirement change.
In plain terms
- If you relied on automatic reloading of reducers during development, you must now wire it up yourself in the file that creates the store.
- The CommonJS build now expects a NODE_ENV environment variable to exist. If your environment does not provide it, use the browser build or define it yourself.
- This version officially supports Redux 3.x, so projects using Redux 3 can install it without peer dependency warnings.
Must act 3 items need code or config changes
What you must change
Breaking2
Reducer hot reloading is now explicit and requires calling replaceReducer() with module.hot API calls where the store is created.
replaceReducer()module.hotmodule.hot.accept()createStore()The CommonJS build again requires process.env.NODE_ENV to be defined, so environments without it must use a browser build or shim it.
process.env.NODE_ENVPlatform1
Declares compatibility with Redux 3.x in peerDependencies.
peerDependencies