npm.io
2.0.1 • Published 2 weeks ago

@nanostores/react

Licence
MIT
Version
2.0.1
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
141

Nano Stores React

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

  • Small. Around 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>
}

  Nano Stores React is built by Evil Martians, an American design and engineering consultancy for developer tools, AI, and cybersecurity startups.


Docs

Read full docs here.

Keywords