You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we have the TypeScript port mostly complete, we can at least start thinking about React 18 compatibility changes.
Most likely we will want to convert our current subscription and change detection logic to use the new React useMutableSource hook instead.
As of [email protected], useMutableSource does appear to be in the current React alpha versions.
I'd like to see some experimental PRs filed that try to switch over to useMutableSource, so we can at least see what sort of changes are needed, and begin to get a sense of what this means for performance. Any PRs should be done against the typescript-port branch as a starting point - we'll hopefully be merging that into master in the near future.
We should probably start with useSelector first, as that's simpler. After that we can look at updating connect as well.
For details on useMutableSource and how it works, see the RFC and PR that added it, as well as some of the discussions on things like "tearing" in the React 18 Working Group:
Background: #1740
Now that we have the TypeScript port mostly complete, we can at least start thinking about React 18 compatibility changes.
Most likely we will want to convert our current subscription and change detection logic to use the new React
useMutableSource
hook instead.As of
[email protected]
,useMutableSource
does appear to be in the current React alpha versions.I'd like to see some experimental PRs filed that try to switch over to
useMutableSource
, so we can at least see what sort of changes are needed, and begin to get a sense of what this means for performance. Any PRs should be done against thetypescript-port
branch as a starting point - we'll hopefully be merging that intomaster
in the near future.We should probably start with
useSelector
first, as that's simpler. After that we can look at updatingconnect
as well.For details on
useMutableSource
and how it works, see the RFC and PR that added it, as well as some of the discussions on things like "tearing" in the React 18 Working Group:There are a few examples of using it, including a couple examples by Daishi Kato of doing Redux subscriptions. Some examples that I've found:
The text was updated successfully, but these errors were encountered: