← React Beginner Questions - Set 9 Q90

What is the Context API in React?

React Beginner Questions - Set 9

Example

const ThemeContext = createContext('light');
<ThemeContext.Provider value="dark"><App /></ThemeContext.Provider>
const theme = useContext(ThemeContext);

What to notice

← Back to the question list