-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
feat: use-sync-external-store #234
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2c251f7:
|
Size Change: -2.85 kB (-6%) ✅ Total Size: 48.9 kB
ℹ️ View Unchanged
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/valtio/8RBT39FXK8hzxM1F9iM3GheATEoh |
… (#461) * add failing test * refactor * fix rendering from parent
This PR uses https://www.npmjs.com/package/use-sync-external-store instead of useMutableSource emulation (useSubscription equivalent). It works both on React 18 and pre-18.
While it doesn't give much difference (technically, it prevents tearing on mount, that's it), and it doesn't change api / behavior, it's a non-trivial change with a new dependency.