PodRocket - A web development podcast from LogRocket

Goodbye, useState with David Khourshid

41 snips
Jul 22, 2025
David Khourshid, founder of Stately.ai, shares his expertise in state management for React applications. He discusses the dangers of overusing useState and introduces discriminated unions and state machines as powerful alternatives. The conversation dives into the role of React server components, emphasizing their benefits for data fetching. Khourshid also addresses the balance between custom solutions and third-party libraries, urging developers to rethink their approach to state modeling for better clarity and efficiency.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Pitfalls of Overusing useState

  • useState is simple to start with but becomes complex as states increase and concerns mix.
  • Overusing useState and useEffect leads to tangled logic and difficulty tracing state changes.
ADVICE

Use useState for UI Local State

  • Use useState for UI related local states only.
  • Avoid using it for complex app states which require grouping and rules to reduce complexity.
INSIGHT

Cascading UseEffects Are Dangerous

  • Cascading chains of useEffect hooks create hard-to-debug state update chains.
  • This pattern often results in complicated and obscure state changes in React apps.
Get the Snipd Podcast app to discover more snips from this episode
Get the app