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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@csark0812/zustand-expo-devtools

v2.1.5

Published

A new DevTools plugin created by create-dev-plugin

Readme

Zustand Expo DevTools

A DevTools plugin that brings Zustand state debugging capabilities to Expo DevTools, allowing you to inspect and debug your Zustand stores directly in the Expo development environment. This plugin works exactly like the built-in Zustand devtools middleware, with the same API and functionality.

Features

  • 🔍 State Inspection - View your Zustand store state in real-time
  • 🎯 Action Tracking - Monitor state changes and actions with named actions
  • 🔄 Time Travel Debugging - Navigate through state history using Redux DevTools
  • 🚀 Expo Integration - Seamlessly integrates with Expo DevTools platform
  • 📱 React Native Support - Works with Expo managed workflow
  • 🌐 Redux DevTools Core - Leverages Redux DevTools app core for state inspection
  • 🏗️ TypeScript Support - Full TypeScript support with proper type definitions
  • Production Safe - Automatically disabled in production builds

Installation

npm install @csark0812/zustand-expo-devtools
# or
yarn add @csark0812/zustand-expo-devtools
# or
pnpm add @csark0812/zustand-expo-devtools

Accessing DevTools

To access the DevTools interface:

  1. Start your Expo development server (npx expo start)
  2. Open your app in Expo Go or development build
  3. Press Shift+M in the Expo development menu to open DevTools
  4. Navigate to the DevTools plugin to inspect your Zustand stores

Quick Start

import { create } from 'zustand';
import { devtools } from '@csark0812/zustand-expo-devtools';

interface CounterState {
  count: number;
  increment: () => void;
  decrement: () => void;
}

const useCounterStore = create<CounterState>()(
  devtools(
    (set) => ({
      count: 0,
      increment: () => set((state) => ({ count: state.count + 1 }), false, 'increment'),
      decrement: () => set((state) => ({ count: state.count - 1 }), false, 'decrement'),
    }),
    {
      name: 'counter-store', // Optional: name your store for better debugging
    }
  )
);

How It Works

This plugin provides the same functionality as Zustand's built-in devtools middleware, but integrated with Expo's DevTools platform:

  1. Store Integration: Wrap your Zustand store with the devtools middleware (same API as Zustand's built-in devtools)
  2. Expo DevTools: Press Shift+M in your Expo development menu to open DevTools
  3. DevTools Plugin: Navigate to the DevTools plugin to inspect your stores
  4. Debug: Inspect state, track actions, and time-travel through your store's history

Configuration Options

interface DevtoolsOptions {
  name?: string;                 // Store name (default: 'zustand')
  enabled?: boolean;            // Enable/disable devtools (default: true)
  anonymousActionType?: string; // Default action name (default: 'anonymous')
  store?: string;              // Store identifier
}

Usage with Actions

For better debugging experience, provide action names when updating state:

const useStore = create<State>()(
  devtools(
    (set) => ({
      // ... your state
      updateUser: (user) => set({ user }, false, 'updateUser'),
      resetState: () => set(initialState, false, 'resetState'),
    }),
    { name: 'user-store' }
  )
);

Usage with Other Middleware

The plugin works well with other Zustand middleware like immer and persist:

import { create } from 'zustand';
import { immer } from 'zustand/middleware/immer';
import { persist, createJSONStorage } from 'zustand/middleware';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { devtools } from '@csark0812/zustand-expo-devtools';

const useStore = create<State>()(
  devtools(
    persist(
      immer((set) => ({
        // ... your state and actions
      })),
      {
        name: 'app-storage',
        storage: createJSONStorage(() => AsyncStorage),
      }
    ),
    { name: 'app-store' }
  )
);

Production Builds

The devtools middleware is automatically disabled in production builds, so you don't need to worry about removing it for production.

Requirements

  • Expo SDK 53+
  • Zustand 5.0.5+
  • React Native / Expo development environment

Development

This repository contains:

  • /src - The main devtools plugin source code
  • /webui - The DevTools web UI that connects to Redux DevTools Extension
  • /examples/basic - Example Expo app demonstrating usage

To run the example:

cd examples/basic
npm install
npx expo start

To develop the plugin:

# Install dependencies
npm install

# For development (rebuilds on changes)
npm run build:dev

# Build the plugin
npm run build

# Build the web UI
npm run web:export

# Build everything
npm run build:all

Development Workflow: After making changes to the plugin source code, run npm run build:dev in the root folder to rebuild the library. This will update the compiled code that the example app uses for testing your changes.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Automated Releases

This repository uses automated versioning and publishing when PRs are merged to main. The version bump type is determined by PR labels:

  • major label → Major version bump (e.g., 2.0.0 → 3.0.0) - Breaking changes
  • minor label → Minor version bump (e.g., 2.0.0 → 2.1.0) - New features
  • patch label → Patch version bump (e.g., 2.0.0 → 2.0.1) - Bug fixes (default)

To control the release type:

  1. Add the appropriate label (major, minor, or patch) to your PR
  2. If no label is added, it defaults to a patch release
  3. When the PR is merged, the version will be automatically bumped and published to npm

License

MIT © Christopher Sarkissian

Related

Inspiration & Credits

This project was inspired by:

Built using: