— Profile picture
9 Jun
Since React 18 is coming i'm compiling some tweets exploring suspense, a groundbreaking new feature.

Suspense allows components to handle async tasks, while the parent control loading, errors and fallbacks. It essentially solves async in front end.

Here are some use cases →
Example #1 — You load an async asset (fetch, wasm, parsing, workers, ...). When it's finished you want to execute a specific action, for instance zoom in.

Since <Model /> is async and <ZoomIn />, which is not, share the same suspense boundary, <ZoomIn /> will not execute before <Model /> is ready.

This is literally all you have to do, drop a component in. ✨
Read 9 tweets
8 Sep 20
we are releasing JŌTAI today github.com/react-spring/j… 🎉 this is @dai_shi 's take of the atomic state model. quite similar to recoil but focusses on a small api surface w/ simpler albeit equally powerful atoms and derived state. jōtai is 100% ready for concurrent mode and suspense
in its simplest form think of it as a global replacement for useState. in scale you can create complex transforms and relations between state atoms. see it in action here: jotai.surge.sh or try it out on codesandbox: codesandbox.io/s/1w52w
you might be wondering why so many libs come from "react-spring". started with an anim lib, turned into a gh-org, and it's been more like a collective recently (say hello discord.gg/ZZjjNvJ), there are 25 devs working for it atm. full rebrand and exciting news coming soon.
Read 4 tweets