Loading video...

Video Failed to Load

Go Home

✍️ New blog post: "Instant Search Params with React Server Components" The result of my three-week obsession with React's new useOptimistic hook — ultimately leading me to a much richer understanding of React transitions. Hope you enjoy!

103,117 views • 2 years ago •via X (Twitter)

10 Comments

Ryan Florence's profile picture
Ryan Florence2 years ago

Didn’t read it yet… is useOptimistic for the pending search param you just selected to instantly go purple instead of after the data comes?

Sam Selikoff's profile picture
Sam Selikoff2 years ago

Correct 👍

Clovis Rosa's profile picture
Clovis Rosa2 years ago

That is the missing pice from the last podcast. Thank you very much! Next stop, YT video pleaseeee! 🙏🏾

Sam Selikoff's profile picture
Sam Selikoff2 years ago

Bingo!

Devon Govett's profile picture
Devon Govett2 years ago

Great post!

Sam Selikoff's profile picture
Sam Selikoff2 years ago

Thanks Devon!

François Best - 🦋's profile picture
François Best - 🦋2 years ago

Interesting! I built `nuqs` with the same idea in mind: keep the UI responsive, while the request is in flight and eventually settles, but that was before useOptimistic existed.

Sam Selikoff's profile picture
Sam Selikoff2 years ago

Very cool! I think higher-level hooks like this still have their place – you could useOptimistic under the hood so it gets the behavior around transitions for free.

Coding in Flow's profile picture
Coding in Flow1 year ago

Why does setOptimistic have to be wrapped into startTransition? I tried moving it outside and the behavior looks the same.

Madat Bayramov's profile picture
Madat Bayramov2 years ago

Just read it, very detailed, and you've included a few good use cases. Worth to read

Related Videos