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

Support react-redux 6 #108

Closed
wants to merge 1 commit into from
Closed

Support react-redux 6 #108

wants to merge 1 commit into from

Conversation

circlingthesun
Copy link

Fixes #101

@ScriptedAlchemy
Copy link
Collaborator

Thanks! For everyone’s learning, including my own - can tell us a bit about what happened and changed it to in the description.. for release notes.

Does this need any updates to tests

@mungojam
Copy link

Nice, looks much simpler now

@ScriptedAlchemy
Copy link
Collaborator

Just waiting on more details so others can benefit. Many will need to port stuff to redux 6. Especially me. So it would be great to have some information about why routesmap needs to come in and such.

Remember, this is helivaly maintained by the community. The often look to other PRs and issues on how to create PRs in our other repos

@cdoublev
Copy link
Contributor

cdoublev commented Dec 17, 2018

routesMap was read from context before, ie. from the legacy React context received as the second argument of a functional component or from an instance property of a React.Component. As of react-redux@v6.0.0, the store state could not be read from legacy context anymore. It has to be read from a connected component via the received props.

Any library that attempts to access the store instance out of legacy context will break

https://github.com/reduxjs/react-redux/releases/tag/v6.0.0

Please take note of how this PR is changing the render tree of a <NavLink> with a duplicated wiring to store (vs #107). I don't know what the perf costs would be but I don't see any pros of doing it this way.

@circlingthesun
Copy link
Author

What @cdoublev said. It looks like we working on a fix at the same time. Avoiding the use of the already connected Link inside an also connected NavLink is probably better. @ScriptedAlchemy you should probably accept #107 as @cdoublev was first. I'll just quickly make some comments over there.

@GuillaumeCisco
Copy link
Contributor

I also experience this kind of error while upgrading to react-redux 6.0.0
Based on both of your PRs #108 and #107, I created this one #113 for unifiying ideas.

It fixes #101 without side effect.
Feel free to update your PRs with ideas in #113, @cdoublev do not hesitate to copy/paste the code.
Thank you both circlingthesun and @cdoublev for your work. I simply rearranged it :)

I can confirm this upgraded code work in our setup (Server side rendering with streaming and caching over http2 secure).

I hope @ScriptedAlchemy will have time to review this and merge it quickly in master. It is cryptic in our upgrade process.

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

Successfully merging this pull request may close these issues.

5 participants