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

    Immutable Update State inside React components with useImmer

    reactReact
    ^16.8.6

    The great thing about having producers outside components is that it is becomes very straightforward to test them independent of our UI logic.

    However, in some cases your logic might be so simple that you want to use Immer inside some of your react components. In this lesson we will discover how. For example by using “useImmer” or “useImmerReducer” from the use-immer package.