There's a faster version of egghead. Click here to try it.
1×
Become a member
to unlock all features
Autoplay

    Improve the usability of Component State Reducers with state change types

    reactReact
    ^16.3.2

    Users of our component can make custom modifications to the state whenever it changes, but in more complex components they may only want to change the state updates for certain types of changes. Let's add a type property to our changes object so people providing a state reducer have more insight into the source of the changes and can reduce the changes based on that information.