Skip to content
Discussion options

You must be logged in to vote

it doesn't use display:none, it also technically doesn't "unmount" - it interrupts rendering.

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").

you see none of the two, here's what happens:

  • component starts to render
  • react-query throws the promise
  • component suspends
  • queryFn finishes fetching
  • component starts render process from scratch
  • now it finishes rendering with data
  • NOW you see the 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 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gper2020
Comment options

Answer selected by gper2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants