https://github.com/joshwrn/zustand-devtools
https://github.com/joshwrn/zustand-devtools
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/joshwrn/zustand-devtools
- Owner: joshwrn
- License: mit
- Created: 2024-08-03T04:55:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-09T15:44:18.000Z (over 1 year ago)
- Last Synced: 2025-03-18T04:34:27.212Z (9 months ago)
- Language: TypeScript
- Homepage: https://joshwrn.github.io/zustand-devtools/
- Size: 346 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zustand State Inspector

## Installation
```bash
npm install zustand-state-inspector
```
## Usage
```tsx
import { create } from "zustand"
import { ZustandDevTools } from "zustand-state-inspector"
const useYourStore = create((set) => ({
count: 0,
inc: (num) => set((state) => ({ count: state.count + num })),
dec: (num) => set((state) => ({ count: state.count - num })),
}))
const App = () => {
const store = useYourStore()
return (
)
}
```
## Props
| Prop | Description |
| --------------- | ------------------------------------------------------------------------------------- |
| state | The zustand store to inspect |
| showDevTools | Take control of the showDevTools state. Will hide the default icon if it's provided |
| setShowDevTools | If you're passing in showDevTools, you need to pass in a setter function to update it |