Created the StateContext.jsx

This commit is contained in:
Mathias Wagner 2023-06-09 02:21:40 +02:00
parent 1587757e69
commit 4bb9b3f974

View File

@ -0,0 +1,13 @@
import {createContext, useState} from "react";
export const StateContext = createContext({});
export const StateProvider = ({ children }) => {
const [currentState, setCurrentState] = useState("Home");
return (
<StateContext.Provider value={{currentState, setCurrentState}}>
{children}
</StateContext.Provider>
)
}