Video: Development History of Zustand

Rate this content
Bookmark
Video Summary and Transcription
The video explores the development history of Zustand, a state management library for React, and how it compares to Jotai, another library developed by the same creator. Zustand's unique approach lies in not using React context for state propagation, which sets it apart from many other state management libraries. The talk highlights the evolution of Zustand, with its initial release in April 2019 and subsequent improvements, including the use of the useSyncExternalStore hook in its latest version, enhancing concurrent rendering capabilities. Zustand's minimal API and small bundle size make it appealing for managing global state in React applications. The discussion also touches on the differences in state management models between Zustand and Jotai, with Jotai using atoms for state representation, avoiding selectors, and focusing on dependency tracking to optimize re-renders. The video also addresses the concept of Zustand derived state, the challenges of Zustand's infinite loop, and mentions the development of Zastad, a similar project.

This talk has been presented at React Summit 2023, check out the latest edition of this React Conference.

Available in Español: Historia de Desarrollo de Zustand

FAQ

Contributors can get involved by improving documentation, adding tests, enhancing existing middleware, and developing third-party libraries to expand the Zestand ecosystem. The project is particularly open to contributions that enhance developer experience and documentation.

Future plans for Zestand include dropping support for React 17 and removing the useSyncExternalStore shim to streamline the library in line with newer React versions. The focus will remain on improving existing features rather than adding new ones, with a strong emphasis on concurrency support and stability.

Zestand is unique because it does not use React context for state propagation, which is common in many other state management libraries. This approach avoids the complexity and overhead associated with context providers, especially in applications where global state is defined at the module level.

The latest version of Zestand, V4, incorporates the useSyncExternalStore hook from React 18, improving concurrent rendering capabilities. It also features enhanced TypeScript types and has undergone significant codebase revisions for better performance and usability.

Zestand and Jotai differ primarily in their state management models. Zestand uses a store with actions and selectors to manage state, whereas Jotai uses a more React-oriented approach with atoms that represent pieces of state and can be combined or derived. Jotai aims to avoid the need for selectors by using dependency tracking to optimize re-renders.

Zestand was initially released in April 2019 and has been developed by a team including Daishi Kato, who joined the development team in August 2020 to enhance its features, particularly for concurrent rendering in future versions of React.

Zestand is a state management library for React that focuses on providing a minimal API and small bundle size. Its primary purpose is to manage global state in React applications, following Flux principles and providing a less opinionated, yet extensible, approach.

Video transcription and chapters available for users with access.