Skip to content
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

You can't await a react state update #65

Open
tonylomaxtk opened this issue Nov 14, 2023 · 0 comments
Open

You can't await a react state update #65

tonylomaxtk opened this issue Nov 14, 2023 · 0 comments

Comments

@tonylomaxtk
Copy link

If this is a requirement (looking at your code it shouldn't be) then something has gone wrong in your logic. If you need to update state based on some external awaited call then await it and once the result is back update the state. Basically just get rid of the await as you don't need it.

https://github.com/fac28/in-house-project/blob/9d2c5085cc1e6508c0d79e905a68988a41513b0b/app/%5Bgame_id%5D/%5Busername%5D/draw/page.tsx#L65C17-L65C17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant