Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any migration guide? #1104

Closed
wolfy1339 opened this issue Dec 5, 2018 · 4 comments
Closed

Any migration guide? #1104

wolfy1339 opened this issue Dec 5, 2018 · 4 comments

Comments

@wolfy1339
Copy link

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

@markerikson
Copy link
Contributor

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):

  • The withRef option: use forwardRef instead, and change any uses of theWrapperComponentInstance.getWrappedInstance() to just be theActualComponentInstance
  • If you were passing store 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.

@geminiyellow
Copy link

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}>

@markerikson
Copy link
Contributor

markerikson commented Dec 6, 2018

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 supasate/connected-react-router#191 for an example of how connected-react-router is changing that way.

I just filed prescottprue/react-redux-firebase#581 to let them know they need to update things.

@arthurgeron-work
Copy link

arthurgeron-work commented Nov 16, 2020

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):

  • The withRef option: use forwardRef instead, and change any uses of theWrapperComponentInstance.getWrappedInstance() to just be theActualComponentInstance
  • If you were passing store 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants