Improve Suspense loading states with useTransition

Share this video with your friends

Send Tweet

This video uses an experimental API that has been changed. useTransition no longer accepts a SUSPENSE_CONFIG. Learn more.

React Suspense with Concurrent mode comes with a default optimization that is optimistic in that it waits a tiny bit for your suspending promise to resolve before making any DOM updates. But this can make the app feel unresponsive for some use cases. The experimental useTransition hook from React gives us more fine-grained control over the timing as well as the ability to show a pending state. Let's try that out here.

Viktor Soroka
Viktor Soroka
~ 5 years ago

I wonder why the value in the form before introducing the useTransition hook was delayed. The form is not rendered within Suspense so why the value there was delayed?