Syntax - Tasty Web Development Treats

React State Round Up

Aug 5, 2020
Dive into the world of React State libraries as the hosts dissect the pros and cons of using Context and Redux. They share tales of performance challenges and the nuances of various state management methods. Discover XState's power alongside ZooStand's simplicity. The conversation offers insights into user-friendly libraries that streamline code with Hooks and Redux Dev Tools. Plus, the hosts unravel the complexities of Apollo Client and highlight useful alternatives like RxJS and React Query, ensuring you navigate your state management wisely.
Ask episode
AI Snips
Chapters
Books
Transcript
Episode notes
ADVICE

Context Optimization

  • Split React Context to avoid re-renders.
  • Separate contexts by functionality (checkout, navigation, alerts).
INSIGHT

Context Fundamentals

  • React Context itself doesn't hold state; it's a delivery mechanism.
  • Use useContext with regular React state for managing data within Context.
ADVICE

Custom Context Hooks

  • Export a custom hook that wraps useContext for cleaner, more readable code.
  • This avoids importing both useContext and the context itself.
Get the Snipd Podcast app to discover more snips from this episode
Get the app