-
Notifications
You must be signed in to change notification settings - Fork 46
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
Experiment: Redux with useMutableSource #12
Conversation
The React Redux binding implementation is surprisingly compact. |
Unfortunately, check 9 is failing. The failure in check 7 is OK, which is impossible. |
This is done with this commit with a patch: diff --git a/packages/react-reconciler/src/ReactFiberHooks.js b/packages/react-reconciler/src/ReactFiberHooks.js
index 375c5e971..5e3f2b587 100644
--- a/packages/react-reconciler/src/ReactFiberHooks.js
+++ b/packages/react-reconciler/src/ReactFiberHooks.js
@@ -1019,7 +1019,7 @@ function useMutableSourceImpl<Source, Snapshot>(
return prevState;
}
- setState({
+ return ({
...prevState,
snapshot: newSnapshot,
}); |
great work! have you patched useMutableSource or is the last version? |
Now, I try the latest one: facebook/react@b028a0b
No difference in result. |
Hoping to support state branching.
Hmm, it tears with useTransition. (It's failing with check 7, but it's because check 6 is not enough.) |
I was probably sleeping. State branching won't work because we don't have update queue. |
As useMutableSource is now in the experimental channel, let's merge this and continue experiments in master. |
useMutableSource is proposed in the RFC.
Let us experiment with it.