パッケージの詳細

@nanostores/react

nanostores384.6kMIT1.0.0

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

store, state, state manager, react

readme

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.


更新履歴

Change Log

This project adheres to Semantic Versioning.

1.0.0

  • Added Nano Stores 1.0 support.
  • Removed Node.js 18 support.

0.8.4

  • Fixed React 19 support (by @Alqanar).

0.8.3

  • Clean package.json.

0.8.2

  • Fixed peer warning with React 19 RC (by @aminabromand).

0.8.1

  • Fixed peer warning with React 19 RC (by @aminabromand).

0.8.0

  • Fixed getSnapshot warning by adding deps options (by @yuyi919).

0.7.3

  • Added Nano Stores 0.11 support.

0.7.2

  • Added Nano Stores 0.10 support.
  • Removed Node.js 16 support.

0.7.1

  • Reverted onStart/onStop fix (by Dan Kozlov).

0.7

  • Moved to Nano Stores 0.9.
  • Fixed unnecessary onStart/onStop calls (by Sergey Kozlov).

0.6

  • Reduced size by using import from React 18 (by Sergey Kozlov).

0.5

  • Moved to Nano Stores 0.8.

0.4.1

  • Fixed peer dependencies (by Tim Su).

0.4

  • Moved to Nano Stores 0.7.

0.3

  • Moved to useSyncExternalStore (by @SukkaW).
  • Moved to Nano Stores 0.6.

0.2

  • Moved to React 18.
  • Removed batch export.

0.1.5

  • Reduced package size.

0.1.4

  • Fixed union types support in useStore (by Aleksandr Slepchenkov).

0.1.3

  • Fixed useStore types (by Aleksandr Slepchenkov).

0.1.2

  • Fixed useStore types.

0.1.1

  • Fixed types.

0.1

  • Initial release.