blob: 91579a4c2cc3f7d7bfcb52edb87c735d3f7ec92c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import React, {createContext, useState} from "react";
// Our StateContext are some variables which we want shared between components.
const StateContext = createContext(null);
function StateContextProvider({children}) {
const state = useState({
loginActive: false,
});
return (
<StateContext.Provider value={state}>
{children}
</StateContext.Provider>
);
}
export {StateContext, StateContextProvider};
|