mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 04:17:13 +00:00
16 lines
360 B
JavaScript
16 lines
360 B
JavaScript
import { createContext, useState } from 'react';
|
|
|
|
const initialValue = true;
|
|
|
|
export const LoadingContext = createContext();
|
|
|
|
export const LoadingProvider = (props) => {
|
|
const [loading, setLoading] = useState(initialValue);
|
|
|
|
return (
|
|
<LoadingContext.Provider value={[loading, setLoading]}>
|
|
{props.children}
|
|
</LoadingContext.Provider>
|
|
);
|
|
};
|