PodRocket

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

No Silver Bullet for State Management

  • There's no one-size-fits-all solution; state concerns vary and must be managed with multiple patterns.
  • Forcing all state into a single global store causes unnecessary complexity in large apps.
ADVICE

Be Explicit with Persistent State

  • Use explicit hooks like useQueryState when persisting state in query strings or local storage.
  • Explicit state persistence helps avoid including unwanted or hidden state unintentionally.
INSIGHT

Store Models: Direct vs Event-Driven

  • State management libraries fall into direct update or event-driven models.
  • Event-driven stores provide better traceability and safer state transitions than direct mutation stores.
Get the Snipd Podcast app to discover more snips from this episode
Get the app