Interview question
What is Zustand? Zustand क्या है?
Answer
// Zustand - minimal state management
import create from 'zustand';
const useStore = create((set) => ({
count: 0,
increment: () => set((state) => ({ count: state.count + 1 })),
decrement: () => set((state) => ({ count: state.count - 1 }))
}));
// Usage
function Counter() {
const count = useStore((state) => state.count);
const increment = useStore((state) => state.increment);
return (
<button onClick={increment}>{count}</button>
);
}Zustand - minimal, simple state management library।Was this answer clear?