diff --git a/examples/with-zustand/lib/store.js b/examples/with-zustand/lib/store.js index 49bc825adc535..75d296fa78ffa 100644 --- a/examples/with-zustand/lib/store.js +++ b/examples/with-zustand/lib/store.js @@ -10,7 +10,11 @@ const initialState = { count: 0, } -export const { Provider, useStore } = createContext(initialState) +const zustandContext = createContext() +export const Provider = zustandContext.Provider +// An example of how to get types +/** @type {import('zustand/index').UseStore} */ +export const useStore = zustandContext.useStore export const initializeStore = (preloadedState = {}) => { return create((set, get) => ({ diff --git a/examples/with-zustand/package.json b/examples/with-zustand/package.json index 1440d8d38a974..7397c5e62c877 100644 --- a/examples/with-zustand/package.json +++ b/examples/with-zustand/package.json @@ -10,7 +10,7 @@ "next": "latest", "react": "^16.9.0", "react-dom": "^16.9.0", - "zustand": "3.5.0" + "zustand": "3.5.1" }, "license": "MIT" }