-
Notifications
You must be signed in to change notification settings - Fork 47.9k
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
Bug: startTransition is causing TypeError when used directly from react #31622
Comments
This looks like it's also using I'd inline all the relevant code of |
With React native web the issue is not visible, we can use the same snack demo to confirm it. How can I or someone else figure out the issue? I gave my findings here in the issue ticket. Some devs in an SWR ticket said this should not be an issue from SWR because the latest release was 6 months ago and the same code & SWR version works on expo SDK 51 without change in SWR itself. Will the problem arise from the React Native core? |
I can confirm this issue is not with web apps using react-dom, I will report to react native core https://stackblitz.com/edit/vitejs-vite-u1tsbe?file=package.json |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
React version: 18.3.1
Steps To Reproduce
Getting this error message
TypeError: Cannot read property 'add' of undefined
swr
because it uses startTransition internallyLink to code example:
Import like this
And use like this
Code from this repository https://github.com/vercel/swr/blob/1585a3e37d90ad0df8097b099db38f1afb43c95d/src/mutation/state.ts#L5-L10
The current behavior
Getting this error when
startTransition
used from React directlyTypeError: Cannot read property 'add' of undefined
On Expo snack the error says
Error: "Cannot read property 'add' of undefined" in TypeError: Cannot read property 'add' of undefined << at requestUpdateLane (/data/user/0/host.exp.exponent/files/.expo-internal/5cb1b0c52b8fcab94364327c83b808ee:18892:43) << at dispatchSetState (/data/user/0/host.exp.exponent/files/.expo-internal/5cb1b0c52b8fcab94364327c83b808ee:16726:33) << at anonymous (swr.mutation:12:14616)
The expected behavior
There is no TypeError,
When I tried using the
startTransition
from theuseTransition
hook the problem got solvedThe text was updated successfully, but these errors were encountered: