Complete the code to create a React context with a default value.
const MyContext = React.[1]('default');
Use React.createContext to create a new context with a default value.
Complete the code to consume a context value inside a functional component.
const value = React.[1](MyContext);Use useContext hook to read the current context value inside a component.
Fix the error in the code to properly provide a context value.
<MyContext.Provider value=[1]>
<ChildComponent />
</MyContext.Provider>The value prop must be passed as a JavaScript expression inside curly braces.
Fill both blanks to create a context and export its provider component.
const [1] = React.createContext(); export const [2] = [1].Provider;
Create a context named ThemeContext and export its Provider as ThemeProvider.
Fill all three blanks to consume context and display its value in a component.
import React, { [1] } from 'react'; function Display() { const value = [2](MyContext); return <p>The value is: [3]</p>; }
Import and use useContext to get the context value, then display it inside the paragraph.
