Become a member
to unlock all features

Create egghead account to access 5000+ tutorials and resources from expert developers.

Create account

    Avoid Accidental Returns of New State by using the void Keyword


    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.