
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.
AI Snips
Chapters
Books
Transcript
Episode notes
Context Optimization
- Split React Context to avoid re-renders.
- Separate contexts by functionality (checkout, navigation, alerts).
Context Fundamentals
- React Context itself doesn't hold state; it's a delivery mechanism.
- Use
useContextwith regular React state for managing data within Context.
Custom Context Hooks
- Export a custom hook that wraps
useContextfor cleaner, more readable code. - This avoids importing both
useContextand the context itself.



