General Questions
What is Create Zustand CLI?
What is Create Zustand CLI?
Do I need to install Zustand separately?
Do I need to install Zustand separately?
Can I use this CLI with an existing project?
Can I use this CLI with an existing project?
create-zustand-store. The tool will create the store in the directory you specify.What Node.js version do I need?
What Node.js version do I need?
node --version.Installation & Setup
How do I install the CLI?
How do I install the CLI?
create-zustand-store command from anywhere.Why do I need to use npm link?
Why do I need to use npm link?
Can I uninstall the CLI?
Can I uninstall the CLI?
Using the CLI
What is a store name?
What is a store name?
useStore, useCartStore, useAuthStore). This becomes both the function name and the filename.Should I choose JavaScript or TypeScript?
Should I choose JavaScript or TypeScript?
How do I define the initial state?
How do I define the initial state?
- Simple:
{"count": 0} - Complex:
{"user": {"name": "John", "age": 30}, "isLoggedIn": false} - Array:
{"items": [], "total": 0}
What are actions?
What are actions?
increment,decrement,reset). The CLI generates empty implementations that you’ll need to fill in with your logic.Can I save my configuration for reuse?
Can I save my configuration for reuse?
zustand-store-config.json file in your project that will pre-fill answers for future stores.Zustand & State Management
What is Zustand?
What is Zustand?
Do I need to wrap my app in a provider?
Do I need to wrap my app in a provider?
Can I use multiple stores?
Can I use multiple stores?
create-zustand-store multiple times to create different stores for different concerns (e.g., useAuthStore, useCartStore, useUIStore).How do I use the generated store in my components?
How do I use the generated store in my components?
Persistence
What does persistence mean?
What does persistence mean?
When should I use persistence?
When should I use persistence?
- User preferences (theme, language)
- Shopping cart contents
- Form draft data
- Authentication state
Can I use persistence with React Native?
Can I use persistence with React Native?
How do I clear persisted data?
How do I clear persisted data?
Customization
Can I change the store directory location?
Can I change the store directory location?
store(default)src/storelib/statehooks/stores
Can I modify the generated store?
Can I modify the generated store?
Can I add more actions later?
Can I add more actions later?
Troubleshooting
The command is not found after npm link
The command is not found after npm link
~/.bashrc or ~/.zshrc:I get a JSON parsing error
I get a JSON parsing error
- ✅ Correct:
{"count": 0, "name": "test"} - ❌ Wrong:
{count: 0, name: test}
The generated actions don't do anything
The generated actions don't do anything
Where can I get more help?
Where can I get more help?
- Troubleshooting guide for common issues
- GitHub repository for issues and discussions
- Zustand documentation for state management questions