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
In the given context the code that is used in the example will break due to javascript execution flow. subscribe is used before it being defined - it throws Uncaught TypeError: subscribe is not a function.
Ideally, all 3 would move the subscribe before uSES. The middle example, moving it to the module, should go above the component (not for syntax reasons, but convention).
Summary
In the given context the code that is used in the example will break due to javascript execution flow.
subscribe
is used before it being defined - it throwsUncaught TypeError: subscribe is not a function
.Page
https://react.dev/reference/react/useSyncExternalStore#my-subscribe-function-gets-called-after-every-re-render
Details
The following code will throw
Uncaught TypeError: subscribe is not a function
. Fix: declaresubscribe
before passing it to the useSyncExternalStore.react.dev/src/content/reference/react/useSyncExternalStore.md
Lines 438 to 447 in b5f5134
The text was updated successfully, but these errors were encountered: