Download Spotify-clone/src/context/AppContext.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 847 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Spotify-clone/src/context/AppContext.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/Spotify-clone/src/context/AppContext.js
-
curl -L -o AppContext.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Spotify-clone/src/context/AppContext.js
847 Bytes
| import { createContext, useState } from "react"; | |
| export const AppContext = createContext(); | |
| export function AppContextProvider({children}){ | |
| const [loading,setLoading] = useState(false); | |
| const [playing,setPlaying] = useState(0); | |
| const [playingTrack,setPlayingTrack] = useState(null); | |
| const [currentTrack,setCurrentTrack] = useState(null); | |
| const [search,setSearch] = useState(""); | |
| const [hamburger,setHamburger] = useState(true); | |
| const value = { | |
| loading, | |
| setLoading, | |
| playing, | |
| setPlaying, | |
| playingTrack, | |
| setPlayingTrack, | |
| currentTrack, | |
| setCurrentTrack, | |
| search, | |
| setSearch, | |
| hamburger, | |
| setHamburger, | |
| } | |
| return( | |
| <AppContext.Provider value={value}> | |
| {children} | |
| </AppContext.Provider> | |
| ) | |
| } | |