Duncan Leung · May 5, 2020
useReducer: A Mental Model for Decoupling Actions from State Updates
0Sign in to vote or save
This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
When to reach for useReducer over useState, and why. The Dan Abramov framing: dispatch tells the reducer what happened, the reducer decides how state changes - so the component never needs to know the update logic.
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.