# Self-review: Create a light-dark theme switcher - Advanced React

1. **When creating a Provider component, what should you do with the children prop that it receives?**
    
    * Nothing, the children prop is not necessary and can be skipped during the rendering.
        
    * You should clone the children inside the component to add the context value to it.
        
    * <mark>You should wrap the JSX that it returns with a Context Provider component and then pass the children through.</mark>
        
2. **Assuming that the default theme for the application is ‘light’, what should be the default value passed to the** `createContext` **call? Select all that apply.**
    
    * <mark>undefined</mark>
        
    * <mark>null</mark>
        
    * <mark>The string "light"</mark>
        
3. **One of the parts of the context injected into the application is a function called** `toggleTheme`**. Assuming that the theme is held in some local state as a string that can be either ‘light’ or ‘dark’. What should be the exact implementation of the** `toggleTheme` **function?**
    
    * <mark>toggleTheme: () =&gt; setTheme(theme === "light" ? "dark" : "light")</mark>
        
    * toggleTheme: (theme) =&gt; setTheme(!theme)
        
    * toggleTheme: () =&gt; setTheme(theme === "light" ? "light" : "dark")
        

---

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726134475720/4f5e59f1-7bc2-4411-a556-4ae18c9fb91b.png align="center")
