Course lesson

Display Loading States Conditionally with React.useTransition's isPending Boolean

It's a good practice to give users immediate feedback while asynchronous work is being completed.

Duration
3 min
Access
Pro
Transcript
Available

It's a good practice to give users immediate feedback while asynchronous work is being completed.

useTransition returns a boolean we can use to conditionally render loading UI. This boolean is the second element in the array useTransitions returns. By convention, it's assigned to a variable named isPending.