I am trying to use React.createContext() with react router but at the moment has been impossible.
const Context = React.createContext()
<Context.Provider value={{ valueTest: 1 }}>
<HashRouter>
<Switch>
<Route
exact
path="/"
render={() => <h1>HelloWorld</h1>} />
</Switch>
</HashRouter>
</Context.Provider>
I always get this error
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Can someone help me?