@nanostores/react
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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 = ({ postId }) => {
  const profile = useStore($profile)
  return <header>Hi, {profile.name}</header>
}

Made at Evil Martians, product consulting for developer tools.


Package Sidebar

Install

npm i @nanostores/react

Weekly Downloads

82,688

Version

1.0.0

License

MIT

Unpacked Size

4.86 kB

Total Files

5

Last publish

Collaborators

  • wobsoriano
  • ai
  • dkzlv
  • ninoid