Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

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

    reactReact
    ^0.0.0-experimental-b53ea6ca0

    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.