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

    Avoid Accidental Returns of New State by using the void Keyword

    reactReact
    ^16.8.6

    A small caveat with Immer is that arrow functions that consist of just an expression, and not a function block, always return a value.

    In this lesson we will show that in these cases the void keyword can be used to avoid accidentally returning new state in addition to modifying the draft.