MENU

Fun & Interesting

Zustand with Context API – An Advanced Pattern

Cosden Solutions 19,585 6 months ago
Video Not Working? Fix It Now

Try Brilliant Free for 30 days + 20% Off Premium Membership β†’ https://brilliant.org/CosdenSolutions πŸ“₯ Design Pattern Document (Newsletter) β†’ https://cosden.solutions/newsletter?s=ytd-midp πŸš€ Project React β†’ https://cosden.solutions/project-react TKDodo's Article β†’ https://tkdodo.eu/blog/zustand-and-react-context Source Code β†’ https://github.com/cosdensolutions/code/tree/master/videos/long/zustand-context-pattern Join The Discord! β†’ https://discord.cosden.solutions VSCode Theme | Font β†’ Material Theme Darker | Menlo, Monaco "monospace" In this video we will take a look at a more advanced pattern in React, which consists of combining Zustand and the Context API to remove some of the limitations of global state. By using the Context API from React we are able to control how global the Zustand store is, and which part of the component tree gets access to it. This unlocks a whole new range of possibilities and combines the best of both worlds!

Comment