Complete the code to consume context using the correct hook.
const value = React.[1](MyContext);The useContext hook is used to consume a React context value inside a functional component.
Complete the code to import the hook needed to consume context.
import React, { [1] } from 'react';
You need to import useContext from React to consume context inside a functional component.
Fix the error in consuming context by filling the blank with the correct context variable.
const theme = useContext([1]);You must pass the context object (usually named ThemeContext) to useContext, not the provider or a hook.
Fill both blanks to consume context and display its value.
const value = [1]([2]); return <div>{value}</div>;
Use useContext with the context object (e.g., MyContext) to get the current context value.
Fill all three blanks to consume context and use it in a component.
import React, { [1] } from 'react'; function MyComponent() { const value = [2]([3]); return <p>{value}</p>; }
Import useContext, then use it with the context object MyContext to get the context value inside the component.