Zustand 5.x

useStore

Subscribes a React component to selected data in a vanilla store.

Formal Syntax & Structure

react syntaxreact
useStore(store, s => s.density)

Working Example

Example Snippetreact
useStore(store, s => s.density)
React Reference