DEV Community

Discussion on: React 18 Alpha is out! Now what?

Collapse
ben profile image
Ben Halpern

This is the first time I've carefully read about Suspense (I've seen it around but always skimmed past actually understanding it).

I like the pattern. It seems like a high value-add to the ecosystem.

Collapse
cassidoo profile image
Cassidy Williams Author

Yes! I think it was much more nebulous before because of the lack of full support, but now it's something that has really practical applications.

Collapse
ben profile image
Ben Halpern

Suspense is labeled "experimental" in Preact... I imagine it will eventually land there too.

Collapse
lukeshiru profile image
LUKESHIRU

I feel kinda weird about it. Is almost like a violation of the one-way data flow, because a child component is updating a "state" in the parent directly when it pleases, and the parent only controls the "fallback". The child is actually expecting to be inside a suspend, so it might not even work outside of one.

I believe that there are clearer ways of handling scenarios as the ones Suspense is trying to solve, with libraries like React Query or even with "vanilla" React hooks.

I might change my opinion when I actually try it.