diff --git a/lib/context-store.js b/lib/context-store.js index 38ff300..7aa2804 100644 --- a/lib/context-store.js +++ b/lib/context-store.js @@ -19,7 +19,7 @@ export const createStore = storeDef => { const context = createContext(null) const Provider = ({ children }) => { const store = useReducerStore(storeDef) - return {children} + return React.createElement(context.Provider, { value: store }, children) } const useStore = () => useContext(context) return { Provider, Consumer: context.Consumer, useStore }