scrimba
Frontend Career Path
Advanced React
Reusability
useContext()
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
useContext()
Expand for more info
App.js
run
preview
console
import React from "react"
import Header from "./Header"
import Button from "./Button"

const ThemeContext = React.createContext()

export default function App() {
return (
<ThemeContext.Provider value="dark">
<div className="container dark-theme">
<Header />
<Button />
</div>
</ThemeContext.Provider>
)
}

export { ThemeContext }
Console
/index.html
-6:32