Complete the code to create a React context using the correct function.
const MyContext = [1]();The createContext function is used to create a new React context object.
Complete the code to provide a value to the context provider.
<MyContext.Provider value=[1]>{children}</MyContext.Provider>The value prop of the provider passes the shared data to consuming components.
Fix the error in consuming context by completing the hook call.
const value = [1](MyContext);The useContext hook is used to read the current context value.
Fill both blanks to create and use a context provider with a default value.
const ThemeContext = [1]('light'); return <ThemeContext.Provider value=[2]>{children}</ThemeContext.Provider>;
We create a context with default 'light' and provide 'dark' as the current value.
Fill all three blanks to consume context and display its value inside a component.
const [2] = [1](MyContext); return <div>The theme is [2].[3].</div>;
We use useContext to get the context value, then access its theme property to display.
