Inexplicable trigger of Suspense #2374
-
Describe the bugI was playing with one of the examples in Sinan Polat's excellent book about Solid, and I came across some behavior that I don't understand. There's a component nested in a
the
(or only have the unconditional call to You can play with the full code here: https://playground.solidjs.com/anonymous/4a5900ee-13a1-411e-8f2c-2156231756ee Your Example Website or Apphttps://playground.solidjs.com/anonymous/4a5900ee-13a1-411e-8f2c-2156231756ee Steps to Reproduce the Bug or Issue
Expected behaviorI would expect the Screenshots or VideosNo response Platform
Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yeah I see the misunderstanding. The first behavior you are seeing isn't Suspense behavior. Basically by reading the ready state you are not reading from the resource value so it doesn't Suspend and it shows You could also get the same UI by nesting Suspense boundaries: https://playground.solidjs.com/anonymous/6e7ac01c-bfce-4644-aebc-df889f4540cb |
Beta Was this translation helpful? Give feedback.
Yeah I see the misunderstanding. The first behavior you are seeing isn't Suspense behavior. Basically by reading the ready state you are not reading from the resource value so it doesn't Suspend and it shows
waiting
whereas when you read directly from the resourcedata1()
it Suspends at the nearest Suspense boundary which displays "Loading Children".You could also get the same UI by nesting Suspense boundaries: https://playground.solidjs.com/anonymous/6e7ac01c-bfce-4644-aebc-df889f4540cb