Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is the useContext hook used for?
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.

What does useContext return?
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.

How do you use useContext with a context created by createContext?
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.

When the context value changes, what happens to components using useContext?
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.

Can you use multiple contexts with 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