Skip to Content
useS v2.0.0 is released 🎉
useS logo

React Hook for State Management

$npm i use-s-react
Getting Started

From Local to Global in One Line

Local State

import { useS } from "use-s-react"; export default function Component() { const [count, setCount] = useS(0); // like useState return ( <button onClick={() => setCount((prev) => prev + 1)} > You clicked {count} times </button> ); }

Global State

import { useS } from "use-s-react"; export default function Component() { const [count, setCount] = useS({ value: 0, key: 'global-counter' }); return ( <button onClick={() => setCount((prev) => prev + 1)} > You clicked {count} times </button> ); }
Copy the global state line to any component — they'll automatically sync!

Everything you need

Powerful features that make state management intuitive and efficient

Global State

Share state across components via key, accessible anywhere

Local State

Works like useState by default when no key is provided

TypeScript Ready

Fully typed with automatic type inference

Auto Immutability

Deep and optimized immutability using efficient cloning

Zero Boilerplate

No providers, context, or wrapper components needed

Tiny Bundle

Less than 2KB min+gzip - performance first

Derived State

Built-in computed values via functions, no external abstraction

Universal

Works in React Web and React Native applications

React 18+

Fully compatible with concurrent rendering and modern React

Modern Patterns

Enables advanced patterns without breaking existing code

Debug Tools

debugGlobalStore() for development insights

Persistence

Built-in state persistence (coming soon)

Ready to simplify your state?

Join developers who are building better React apps with useS