Zukeeper
Zukeeper copied to clipboard
🙋 🙋 SyntaxError: Cannot use import statement outside a module
Hello~
'next.js' is being used and if you try to run the code below, you will get an error. Please check it.
javascript
import { create } from 'zustand'
import zukeeper from 'zukeeper'
const initialState = { count: 0 } const CounterStore = create( zukeeper((set) => ({ ...initialState, increment: () => set((state) => ({ count: state.count + 1 })), decrement: () => set((state) => ({ count: state.count - 1 })), resetCounterStore: () => set(initialState) })) )
window.store = CounterStore
export default CounterStore
Same issue here. Probably due to the SSR in nextjs.
Same issue here but Typescript
Don't want to hate on this package nor the authors - I really like the idea and effort - but FYI: it just works with redux devtools https://github.com/pmndrs/zustand#redux-devtools