-
Hello, could you please help me with the following? Does React's Suspense I am asking because I seem to find conflicting info :
If your answer is "it unmounts the component" , can you please explain to me why I am not seeing "UNMOUNTS" in the following code? (I only see "MOUNTS").
In other words, could you please clarify the internal workings of react's Suspense and how this affects react-query ? Stale queries are refetched automatically in the background when: (In addition , the query is not getting enabled/disabled and there is no refetchInterval set either) Btw, using react-query dev-tools , I see that in my real life situation the query has a staleTime of 1 second. If I increase this amount a bit , then the 2nd fetching does not take place. Many thanks for your time! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
it doesn't use
you see none of the two, here's what happens:
you can see this in your example if you add more log statements: https://codesandbox.io/s/objective-bogdan-gff8c5?file=/src/index.js so when you suspend, no effect runs, because effects run "after" rendering, and with suspense, you never get that far. |
Beta Was this translation helpful? Give feedback.
it doesn't use
display:none
, it also technically doesn't "unmount" - it interrupts rendering.you see none of the two, here's what happens:
MOUNTS
text.you can see this in your example if you add more log statements: https://codesandbox.io/s/objective-bogdan-gff8c5?file=/src/index.js
so when you suspend, no effect runs, because effects …