Don't use JSX

This commit is contained in:
Alfred Melch 2020-02-01 14:51:53 +01:00
parent 6fbca8a306
commit 3255c42253

View File

@ -19,7 +19,7 @@ export const createStore = storeDef => {
const context = createContext(null)
const Provider = ({ children }) => {
const store = useReducerStore(storeDef)
return <context.Provider value={store}>{children}</context.Provider>
return React.createElement(context.Provider, { value: store }, children)
}
const useStore = () => useContext(context)
return { Provider, Consumer: context.Consumer, useStore }