const [state, dispatch] = React.useReducer(reducer, initialState); const value = { state, dispatch }; return <Store.Provider value={value as MyContextType}>{props.children}</Store.Provider>;