Think of React Components as State Machines, Not Functions

Michael Landis
Level Up Coding
Published in
7 min readJun 15, 2021

--

Photograph by BlurryMe on ShutterStock

When React Components moved from classes to functions, all the buzz was about transitioning from Object-Oriented Programming to Functional Programming. Functional programming has two goals in mind:

  1. You get the same results when you provide the same inputs to a function.
  2. The function’s only goal is to create an output. It doesn’t try to do…

--

--