Simplify a Component Reducer with the React setState Hook

InstructorKent C. Dodds

Share this video with your friends

Send Tweet

Having a reducer is great for complex components but for our simple Stopwatch it’s a layer of abstraction that might not be necessary.

We'll cover:

  • Converting your reducer into a function that shallow merges the new state into the old
  • Refactoring your dispatch function into setState
Gautham Stalin
~ 6 years ago

Didn't see the setState coming. Great tutorial!!

Srinivas Kasiriveni
~ 6 years ago

Great tutorial!!

Ajay Kumar
~ 5 years ago

Magic of logical thinking !.

Terry DI LUZIO
~ 5 years ago

Very elegant, great one Kent