Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What does the useContext hook consume?
A. To create a context
B. To consume context values in functional components
C. To provide context
D. To update context
Direction: Choose the correct option

Q2.

How do you use useContext to get the value from MyContext?
A. The current context value
B. The context provider
C. An object with value and setter
D. A setter function
Direction: Choose the correct option

Q3.

Can useContext be used in class components?
A. const value = useContext();
B. const { value } = useContext(MyContext);
C. const value = useContext(MyContext);
D. const value = useContext(MyContext.Provider);
Direction: Choose the correct option

Q4.

What happens when the context value changes?
A. They re-render with the new value
B. Only the provider updates
C. They do not re-render
D. They unmount
Direction: Choose the correct option

Q5.

Is it possible to update context from a consumer using useContext?
A. Yes, by calling useContext multiple times
B. No, it's not allowed
C. Yes, but only with the same context
D. No, only one per component