Created the MusicContext.jsx
This commit is contained in:
parent
8abec3c701
commit
84294b7a68
13
client/src/common/contexts/MusicContext.jsx
Normal file
13
client/src/common/contexts/MusicContext.jsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import {createContext, useState} from "react";
|
||||||
|
|
||||||
|
export const MusicContext = createContext({});
|
||||||
|
|
||||||
|
export const MusicProvider = ({children}) => {
|
||||||
|
const [musicEnabled, setMusicEnabled] = useState(true);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MusicContext.Provider value={{musicEnabled, setMusicEnabled}}>
|
||||||
|
{children}
|
||||||
|
</MusicContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user