Comments (2)
A useSyncExternalStore
update can't be a transition — that's why it's a "sync" external store. Only React-managed state like useState
or useReducer
can be updated in a transition. That's the tradeoff of useSyncExternalStore
, and why it's only recommended to use if you can't let React drive the state updates.
from react.
Hi @gaearon!
First and foremost: thanks a lot for such a quick replay!
Yeah, I suppose that makes sense. I actually suspected that could have been the case. However, I did check in the docs and there was no mention of this on the "caveats" section of the startTransition
docs, nor anywhere else on the docs of usSyncExternalStore
. So yeah, that combined with the fact that the error is a bit misleading, made me think that perhaps this was a bug.
Please understand that I'm not complaining, I'm just sharing this feedback so that these things can be improved. Although, I'm sure that you must have bigger fish to fry. Anyways, I will try to find some time during this week to open a PR to -at least- try to improve the docs.
Thanks again!
from react.
Related Issues (20)
- Feature: Release ReactCurrentDispatcher as a consumable API to be used in conjunction with useExternalSyncStore
- Bug: dynamic import component which use useMemo internaly failed HOT 2
- Bug: Add LinkedIn Tab to website HOT 9
- Bug: HTML element <col> cannot be used as a direct descendant of <table> HOT 1
- Bug: Error in the react web page. (Go full-stack with a framework) HOT 17
- [DevTools Bug] Cannot add node "295" because a node with that id is already in the Store. HOT 1
- Lightweight React 19.x [Feature request/Suggestion] HOT 1
- Bug: test HOT 1
- Bug: useEffect runs with newer scope than the one that triggered the effect HOT 4
- [DevTools Bug] Could not find node with id "155" in commit tree HOT 1
- [DevTools Bug]: _jsxDEV is not a function HOT 3
- Bug: Runtime Error App.js: (0 , _reactDom.useFormStatus) is not a function (5:22) HOT 3
- Bug: Server renders inconsistent attribute values HOT 6
- Questions and Help: useMemo vs Normal Object HOT 1
- Components and Profiler don't appear in DevTools HOT 3
- Bug: Should have an queue. This is likely to bug in react. Please file an issue HOT 6
- Bug: Tab focus does not move to the correct element in Firefox when unmounting on key down HOT 1
- NYT: Scripts executing in `dangerouslySetInnerHTML` interfere with `hydrateRoot`, causing a client-side re-render HOT 12
- [DevTools Bug]: React instrumentation encountered an error: TypeError: e.hasOwnProperty is not a function. HOT 4
- Bug: Different file (/usr/share/nodejs/react-is/index.js ) contents when installing via "apt install" and build from source, install package. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.