Learning on Web Dev Open is free for all.

Framework Internals > State, by where it livesA reducer, when the transitions are the point
Phase 04State, by where it lives202 of 434

A reducer, when the transitions are the point

Convert a component with six useState calls into a state machine where the illegal transitions cannot be expressed.

Build45 minAI pair

Build this in your own editor

This one runs on your machine rather than in the browser workbench. Work to the outcomes below, then come back and mark it complete.

You should now be able to

  • Model a feature as states and transitions rather than flags
  • Make an impossible combination a compile error
Ask the community

Loading…