useOptimistic. The React 19 new hook
React 19 hits the mark with this new release.
Not long ago, libraries like React Query gave us some really cool and useful features...
One of the best? Optimistic updates.
The first time you see this...
It’s crazy! What do you think?
You can update the data on the UI for the user the right way,
even before an API call is finished…
Yeah! That’s cool, my friend!
That’s exactly what the new React hook does.
The useOptimistic hook.
It’s awesome!
You can update the UI... with the data you hope will be there if all goes well.
While the async request is underway.
The new useOptimistic hook make it easy.
Try it out
And let me know what you think.
Until then, if you want to make it easy to use TS in React projects...
And see how using the best practices in React can make a difference.
A lot.
For those who like things easy,
and don’t want to waste time on things that don’t matter, it’s right here:
P.S. Above.