Skip to content

Upgrading react-redux 5 to 6

Breaking5.1.2 → 6.0.1Breaking4Platform1New1Changed6Fixed4Other1

BreakingUpgrade verdict

3 breaking changes and a platform requirement change.

  • 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.
4 items need code or config changes

Drops react-lifecycles-compat.

Installs 8 packages in all (was 9).

Breaking3
Removes support for passing store as a prop to a connected component; use a custom context prop instead.
storecontextProviderconnect
Replaces the withRef option to connect with forwardRef.
connectwithRefforwardRef
Libraries reading the store from legacy context break because store state is now placed in a <Context.Provider>.
Context.Providerconnected-react-routerreact-redux-subspace
Platform1
Relaxes the React peer dependency back to 16.4 and above.