v8.1.1
This bugfix release tweaks the recent lazy context setup logic to ensure a single React context instance per React version, and removes the recently added RTK peerdep to fix an issue with Yarn workspaces.
Changelog
React Context Singletons
React Context has always relied on reference identity. If you have two different copies of React or a library in a page, that can cause multiple versions of a context instance to be created, leading to problems like the infamous "Could not find react-redux context" error.
In v8.1.0, we reworked the internals to lazily create our single ReactReduxContext
instance to avoid issues in a React Server Components environment.
This release further tweaks that to stash a single context instance per React version found in the page, thus hopefully avoiding the "multiple copies of the same context" error in the future.
What's Changed
- fix: fix typescript error on non exported type by @luzzif in #2034
- create singleton context by React version by @phryneas in #2039
- remove RTK peerDep by @markerikson in 44fc725
Full Changelog: v8.1.0...v8.1.1