Put in order · React Native course · Module 2: Lists and styles

Context API for Themes

Arrange the steps of creating a theme system with Context API:

Items to put in order

  • 2. Create ThemeProvider with useState
  • 3. Wrap the application in ThemeProvider
  • 1. Create ThemeContext with createContext()
  • 4. Use useContext(ThemeContext) in components
Show the answer

Correct order:

  1. 1. Create ThemeContext with createContext()
  2. 2. Create ThemeProvider with useState
  3. 3. Wrap the application in ThemeProvider
  4. 4. Use useContext(ThemeContext) in components