3 ms·
We use the legacy Context API: https://github.com/reduxjs/react-redux/blob/47facdbcae2412d37d72fa5c37cb4e0cd64a9b4a/src/components/connectAdvanced.js#L139-L146
by timdorr 8y ago
We use the legacy Context API: https://github.com/reduxjs/react-redux/blob/47facdbcae2412d37d72fa5c37cb4e0cd64a9b4a/src/components/connectAdvanced.js#L139-L146 https://github.com/reduxjs/react-redux/blob/47facdbcae2412d3...
This article is looking at the new Context API, which uses React.createContext() to create a Provider/Consumer pair of plain components. This has a number of differences in behavior, most critically around blocking updates incorrectly.
We are looking to switch to the newer API in 6.0. We have two in-progress PRs for this:
https://github.com/reduxjs/react-redux/pull/1000 https://github.com/reduxjs/react-redux/pull/1000
https://github.com/reduxjs/react-redux/pull/995 https://github.com/reduxjs/react-redux/pull/995
- jefflombardjr 8y agoVery cool, thanks for the clarification. To me, this is yet another perk of using RR on top of the actual api. As someone who works on a smaller team, updating our projects to use the new context api would be a significant undertaking. By using RR, the implementation details are left better equipped engineers, our team can focus on meeting business requirements.
- acemarke 8y agoYep, and that was always the advice from the React team. "Don't use legacy context directly in your apps. Libraries may need to use it. If you _need_ to use it, wrap it up in a HOC or something so that you can update it in one place later."