Don't use JSX
This commit is contained in:
parent
6fbca8a306
commit
3255c42253
@ -19,7 +19,7 @@ export const createStore = storeDef => {
|
|||||||
const context = createContext(null)
|
const context = createContext(null)
|
||||||
const Provider = ({ children }) => {
|
const Provider = ({ children }) => {
|
||||||
const store = useReducerStore(storeDef)
|
const store = useReducerStore(storeDef)
|
||||||
return <context.Provider value={store}>{children}</context.Provider>
|
return React.createElement(context.Provider, { value: store }, children)
|
||||||
}
|
}
|
||||||
const useStore = () => useContext(context)
|
const useStore = () => useContext(context)
|
||||||
return { Provider, Consumer: context.Consumer, useStore }
|
return { Provider, Consumer: context.Consumer, useStore }
|
||||||
|
Loading…
Reference in New Issue
Block a user