-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(types): use react 18 types #3482
Conversation
it kind of used a global React and that didn't work
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tanstack/react-query/9b98tPTHwh2CpWQjbbxgX9sp1z4h |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit effcf06:
|
@@ -147,7 +147,7 @@ describe('PersistQueryClientProvider', () => { | |||
|
|||
return ( | |||
<div> | |||
<h1>{state.data}</h1> | |||
<h1>{String(state.data)}</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@artysidorenko I think the react 18 type upgrades have shown an issue with the types of useQueries
: Here, the type of state.data
is inferred to string | Promise<string> | undefined
, which cannot be rendered.
I will create a separate issue for this with a failing test case, just to let you know :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow-up issue: #3483
move the null coercion into the String constructor
Codecov Report
@@ Coverage Diff @@
## beta #3482 +/- ##
==========================================
- Coverage 96.94% 96.94% -0.01%
==========================================
Files 46 46
Lines 2391 2390 -1
Branches 714 714
==========================================
- Hits 2318 2317 -1
Misses 71 71
Partials 2 2
Continue to review full report at Codecov.
|
because technically, it could live next to your App, as long as it's under the Provider: <QueryClientProvider> <Hydrate /> <App /> </QueryClientProvider>
🎉 This PR is included in version 4.0.0-beta.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@tannerlinsley Any chance we could get a fix for |
Why do you want to use react18 with react-query 3.x? Imo this is just asking for troubles as soon as you start to use concurrent features. They will not work in all cases with v3. If you want to use react18, please use v4. |
Thanks, I missed that 3.x isn't intended to work with react18. |
No description provided.