Question · JavaScript and React course · Module 4: Context API and useReducer
Default Context Values
When is the default context value passed to createContext used?
Answer options
- Always, when a component renders for the first time
- Never, default values are only for documentation
- When Provider receives undefined as value
- When a component uses useContext outside of a Provider
You can check the correct answer by solving this task in the CodeWorlds game.