Upgrading react-redux 5 to 6
Breaking5.1.2 → 6.0.1Breaking4Platform1New1Changed6Fixed4Other1
BreakingUpgrade verdict
3 breaking changes and a platform requirement change.
In plain terms
- You can no longer hand a store directly to a connected component as a prop; pass a custom context to Provider and the component instead.
- The old option for getting a ref to the wrapped component is gone; use the new option instead.
- Third-party libraries that grabbed the store from the old React context will stop working.
- This version works with React 16.4 and newer again, instead of requiring a stricter React version.
Must act 4 items need code or config changes
Drops react-lifecycles-compat.
Installs 8 packages in all (was 9).
What you must change
Breaking3
Removes support for passing
store as a prop to a connected component; use a custom context prop instead.storecontextProviderconnectReplaces the
withRef option to connect with forwardRef.connectwithRefforwardRefLibraries reading the store from legacy context break because store state is now placed in a
<Context.Provider>.Context.Providerconnected-react-routerreact-redux-subspacePlatform1
Relaxes the React peer dependency back to 16.4 and above.