Is there any documentation on how to migrate from v5 to v6?
I'm not exactly sure what to change or how to change it
Migration should just be a matter of updating your package.json from "react-redux" : "^5.0" to "react-redux" : "^6.0", and reinstalling with your package manager of choice.
If you are using one of the couple features affected by breaking changes (which is unlikely):
withRef option: use forwardRef instead, and change any uses of theWrapperComponentInstance.getWrappedInstance() to just be theActualComponentInstancestore as a prop to a connected component (likely in a test), you'll need to render a <Provider store={store}> around it. That should be it.
hi @markerikson , v5 > v6,
react-dom.production.min.js:3833 Error: Could not find "store" in either the context or props of "Connect(FirestoreConnect(t))". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(FirestoreConnect(t))".
i did pass store use this:
<ReduxProvider store={store}>
Did you happen to just ask that question on Reddit, as well? I answered it there, but I'll paste the answer here too.
The redux-firestore-connect library appears to be grabbing the Redux store out of old context. Per the release notes, that was never supported, and will break in v6.
That library will need to be modified to access the store out of new context instead. See https://github.com/supasate/connected-react-router/pull/191 for an example of how connected-react-router is changing that way.
I just filed https://github.com/prescottprue/react-redux-firebase/issues/581 to let them know they need to update things.
Migration should just be a matter of updating your
package.jsonfrom"react-redux" : "^5.0"to"react-redux" : "^6.0", and reinstalling with your package manager of choice.If you are using one of the couple features affected by breaking changes (which is unlikely):
- The
withRefoption: useforwardRefinstead, and change any uses oftheWrapperComponentInstance.getWrappedInstance()to just betheActualComponentInstance- If you were passing
storeas a prop to a connected component (likely in a test), you'll need to render a<Provider store={store}>around it.That should be it.
Maybe this should be mentioned in the Releases on 6.0 notes under the Breaking Changes section, it's very likely that devs will go there first, and getWrappedInstance is not mentioned there.
Most helpful comment
Migration should just be a matter of updating your
package.jsonfrom"react-redux" : "^5.0"to"react-redux" : "^6.0", and reinstalling with your package manager of choice.If you are using one of the couple features affected by breaking changes (which is unlikely):
withRefoption: useforwardRefinstead, and change any uses oftheWrapperComponentInstance.getWrappedInstance()to just betheActualComponentInstancestoreas a prop to a connected component (likely in a test), you'll need to render a<Provider store={store}>around it.That should be it.