Created the StateContext.jsx
This commit is contained in:
parent
1587757e69
commit
4bb9b3f974
13
webui/src/common/contexts/StateContext/StateContext.jsx
Normal file
13
webui/src/common/contexts/StateContext/StateContext.jsx
Normal 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>
|
||||
)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user