update
This commit is contained in:
6
src/Contexts/GlobalStateContext.jsx
Normal file
6
src/Contexts/GlobalStateContext.jsx
Normal file
@@ -0,0 +1,6 @@
|
||||
// GlobalStateContext.js
|
||||
import { createContext } from 'react';
|
||||
|
||||
const GlobalStateContext = createContext();
|
||||
|
||||
export default GlobalStateContext;
|
||||
20
src/Contexts/GlobalStateProvider.jsx
Normal file
20
src/Contexts/GlobalStateProvider.jsx
Normal file
@@ -0,0 +1,20 @@
|
||||
// GlobalStateContext.js
|
||||
import React, { useState } from "react";
|
||||
import GlobalStateContext from "./GlobalStateContext";
|
||||
|
||||
|
||||
const GlobalStateProvider = ({ children }) => {
|
||||
const [isAuthenticate, setIsAuthenticate] = useState(false);
|
||||
|
||||
return (
|
||||
<GlobalStateContext.Provider
|
||||
value={{
|
||||
isAuthenticate,
|
||||
setIsAuthenticate,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</GlobalStateContext.Provider>
|
||||
);
|
||||
};
|
||||
export default GlobalStateProvider;
|
||||
Reference in New Issue
Block a user