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

    Block a State Transition with a Guard

    reactReact
    >=16.9.0

    If a network call returns an empty list, that should be rendered differently than a list with elements in it. We’ll create two substates of the http success state (withData and withoutData) and choose which substate to transition to based on the http response using an automatic transition and a guard.