npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-constore

v1.1.1

Published

Lightweight and efficient state management for React with TypeScript support

Readme

React ConStore

Ultra-lightweight state management for React 18+ applications (~950B gzipped)

📊 Quick Stats

| 📦 NPM Package | 📏 Bundle Size | ⭐ GitHub Stars | 📥 Downloads | |----------------|----------------|-----------------|--------------| | react-constore | ~950B gzipped | ⭐ Star us! | 📈 NPM Trends |

✅ Features

  • TypeScript Ready - Full type safety out of the box
  • React 18+ Compatible - Concurrent features supported
  • Zero Dependencies - No external packages needed
  • Devtools - use Redux-Devtools for debugging
  • SSR Ready - Works with Next.js App Router
  • Tree Shakeable - Only bundle what you use
  • MIT Licensed - Free for commercial use

🔗 Quick Links

🚀 Why React ConStore?

// Traditional React state management ❌
const [count, setCount] = useState(0);
const [user, setUser] = useState({ name: 'Guest' });
const [todos, setTodos] = useState([]);
// Props drilling nightmare... 😱

// With React ConStore ✅
const store = createStore({
  count: 0,
  user: { name: 'Guest' },
  todos: []
});

// Use anywhere, anytime 🎉
const [count, setCount] = store.useStoreKey('count');

✨ Key Features

| Feature | Description | Benefit | |---------|-------------|---------| | 🪶 Ultra Lightweight | Less than 1KB gzipped | Faster bundle, better performance | | ⚛️ React 18/19 Ready | Concurrent features, automatic batching | Future-proof your app | | 🎯 Smart Re-renders | Deep equality checks | Only render when data actually changes | | 🔍 Selective Subscriptions | Subscribe to specific keys | Granular control over updates | | 📝 Full TypeScript | Complete type safety | Catch bugs at compile time | | 🌐 SSR Compatible | Next.js 13+ App Router | Server-side rendering support |

📦 Installation

# npm
npm install react-constore

# yarn
yarn add react-constore

# pnpm
pnpm add react-constore

🎯 Quick Start

'use client'; // for Next.js App Router

import createStore from 'react-constore';

// 1. Create your store
const store = createStore({
  count: 0,
  user: { name: 'Guest', age: 25 },
  todos: [],
  theme: 'light'
});

// 2. Use in components
function Counter() {
  const [count, setCount] = store.useStoreKey('count');
  
  return (
    <div>
      <h2>Count: {count}</h2>
      <button onClick={() => setCount(count + 1)}>
        Increment
      </button>
      <button onClick={() => setCount(c => c + 1)}>
        Functional Update
      </button>
    </div>
  );
}

function UserProfile() {
  const [user, setUser] = store.useStoreKey('user');
  
  return (
    <div>
      <h2>{user.name} (Age: {user.age})</h2>
      <button onClick={() => setUser({ ...user, age: user.age + 1 })}>
        Happy Birthday! 🎉
      </button>
    </div>
  );
}

// 3. Components automatically sync!
function App() {
  return (
    <div>
      <Counter />
      <UserProfile />
    </div>
  );
}

📚 Documentation

🚀 Getting Started

📖 API Reference

  • Hooks Guide - useStoreKey(), useStoreKeys(), useStore()
  • Store API - getState(), setState(), subscribe()

🔧 Advanced Usage

🔄 Migration & Comparison

📚 Best Practices & Help

📊 Bundle Size Comparison

| Library | Size (gzipped) | Features | |---------|----------------|----------| | React ConStore | ~950B | ✅ Hooks ✅ TypeScript ✅ SSR ✅ DevTools ✅ Middleware ✅ Persist | | Redux Toolkit | ~3KB | ✅ DevTools ✅ Middleware ✅ Time Travel ❌ Simple API | | Zustand | ~600B | ✅ Simple ✅ Middleware ❌ Built-in TypeScript | | Jotai | ~4KB | ✅ Atomic ✅ TypeScript ❌ Learning Curve |

🆚 When to Use

Use React ConStore when:

  • ✅ You want minimal bundle size
  • ✅ Simple to medium complexity apps
  • ✅ TypeScript-first development
  • ✅ React 18+ features are important
  • ✅ Devtools for debugging
  • ✅ Custom middleware

Consider alternatives when:

  • 🤔 Redux Toolkit: Need time-travel debugging, complex middleware
  • 🤔 Zustand: Need advanced features (immer, persist, devtools)
  • 🤔 Jotai: Bottom-up atomic state management
  • 🤔 Context API: Very simple, component-local state

📄 License

MIT © Mostafa Rastegar


Made with ❤️ for the React community