Install npm install zustand ----- yarn add zustand Store 생성 "store/useStore.js" import create from "zustand"; const useStore = create((set) => ({ count: 1, inc: () => set(state => ({ count: state.count + 1 })), dec: () => set(state => ({ count: state.count - 1 })) })); export default useStore; Store 사용 const { count, inc, dec } = useStore(); return ( <> <span>{count}</span> <button onClick={inc}>up</button> <button onClick={dec}>down</button> </> ) 참고 링크 Zustand - Redux, 간단하게 써보세요! "상태 관리" 하면 어떤...
#react
#redux
#zustand
#관리
#리덕스
#리엑트
#상태
#상태관리
원문링크 : [React] 리엑트 상태관리 Zustand (리덕스 대체)