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: use() hook #28588
Comments
It's not because of Suspense or a bug, but the use() hook isn't cached by default, so you will see a lot of api calls when using it. I would prefer you to go with a library like react-query to handle data fetching in React rather than using 'use' for that. |
See here: https://react.dev/reference/react/use |
As @albeniskerqeli10 said, the promise needs to be cached. The docs don't mention that unfortunately yet which we need to fix. |
Thank so much. I got it |
React version:
"react": "0.0.0-experimental-4b84f1161-20240318",
"react-dom": "0.0.0-experimental-4b84f1161-20240318",
Link code example: https://github.com/bradtraversy/react-19-playground/blob/main/src/components/useExample1/Joke.jsx
The text was updated successfully, but these errors were encountered: