@nanostores/react

v0.2.0
React integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores
store state state manager react react native

Nano Stores React

React integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores.

  • Small. Less than 1 KB. Zero dependencies.
  • Fast. With small atomic and derived stores, you do not need to call the selector function for all components on every store change.
  • Tree Shakable. The chunk contains only stores used by components in the chunk.
  • Was designed to move logic from components to stores.
  • It has good TypeScript support.
import { useStore } from '@nanostores/react'

import { profile } from '../stores/profile.js'

export const Header = () => {
  const { userId } = useStore(profile)
  return <header>{currentUser.name}</header>
}

Made at Evil Martians, product consulting for developer tools.


npm i @nanostores/[email protected]

Metadata

  • MIT
  • ^12.0.0 || ^14.0.0 || >=16.0.0
  • Andrey Sitnik
  • released 3/29/2022

Downloads