Andy Van Slaars

Andy Van Slaars

moon indicating dark mode
sun indicating light mode

On state management in React

  • There’s a good chance, you’re making it harder than it needs to be.
  • Most state is not global in nature, so it shouldn’t be stored or managed globally
  • Sometimes, you might have some truly global state. In those cases, store it globally… it’s not one-size-fits-all.
  • Form input state should never be global.
  • When you hear that state should have “a single source of truth” that means a specific piece of state should have one source of truth. It does not mean that all state in your entire application needs to share the same source of truth.