Replies: 3 comments 1 reply
-
because in strict mode, react18 has strict effects, which means all side-effects run twice in short succession. If you don't consume the provided signal, react-query sees the second time that the query is already running and can dedupe, just as if two components would request data at the same time, or just as if the user navigates away from the page and comes back really fast. If you consume the signal, what happens is:
this is also expected behaviour - it is also what you would get when the user navigates away from the page and them comes back. If they do this fast, it will also seem as if you'd fetch twice. There is no amount of time we could wait to see if an observer re-mounts again, and since this only happens in dev env and react18 and strict mode, this is fine imo. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Is there any test I can do on my device? Could there be two accounts
associated with my name or email address?
Max Scheder
…On Wed, Dec 28, 2022 at 7:57 PM shanliu ***@***.***> wrote:
thx..
This like black magic.
—
Reply to this email directly, view it on GitHub
<#4718 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVJPJE5HCB3N5XT7PHKKQP3WPT43HANCNFSM6AAAAAATLDNGM4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions