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
Hi, i have a question about notifyOnChangeProps. Docs says that the default behavior is tracked, but I see some unexpected re-renders and I'm trying to understand why they are happening.
I expect to see 2 renders: first when data is undefined and second when the data comes from the queryFn. Somehow i see 3 renders and i can't understand why.
Go to the minimal reproducible example, refresh the page and check console logs.
Expected behavior
I expect to see 2 renders: first when data is undefined and second when the data comes from the queryFn. Somehow i see 3 renders and i can't understand why.
How often does this bug happen?
Every time
Screenshots or Videos
Platform
macOS Ventura
Chrome Version 107.0.5304.110 (Official Build) (x86_64)
Tanstack Query version
^4.16.1
TypeScript version
^4.6.4
Additional context
No response
The text was updated successfully, but these errors were encountered:
and all the upstream issues about react18 and batching with useSyncExternalStore that are linked there. I think the react team has already agreed that this needs addressing on their end. I don't see much we can do here for now.
Describe the bug
Hi, i have a question about
notifyOnChangeProps
. Docs says that the default behavior istracked
, but I see some unexpected re-renders and I'm trying to understand why they are happening.Please take a look at this example:
https://codesandbox.io/s/quizzical-montalcini-jm2dyf?file=/src/index.js
I expect to see 2 renders: first when
data
is undefined and second when thedata
comes from thequeryFn
. Somehow i see 3 renders and i can't understand why.Your minimal, reproducible example
https://codesandbox.io/s/quizzical-montalcini-jm2dyf?file=/src/index.js
Steps to reproduce
Go to the minimal reproducible example, refresh the page and check console logs.
Expected behavior
I expect to see 2 renders: first when data is undefined and second when the data comes from the queryFn. Somehow i see 3 renders and i can't understand why.
How often does this bug happen?
Every time
Screenshots or Videos
Platform
Tanstack Query version
^4.16.1
TypeScript version
^4.6.4
Additional context
No response
The text was updated successfully, but these errors were encountered: