Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is the useReducer hook typically used for?
A. Creating refs
B. Optimizing performance
C. Handling side effects
D. Managing complex state logic with multiple sub-values
Direction: Choose the correct option

Q2.

What does useReducer return?
A. The current state and a dispatch function
B. The state and a setter
C. A reducer object
D. An array with state and reducer
Direction: Choose the correct option

Q3.

What is the role of the reducer function in useReducer?
A. It renders the component
B. It specifies how the state changes in response to actions
C. It handles side effects
D. It initializes state
Direction: Choose the correct option

Q4.

Which action object property is conventionally used to describe the type of update?
A. action
B. type
C. name
D. payload
Direction: Choose the correct option

Q5.

When might you prefer useReducer over useState?
A. When you have deep updates
B. When next state depends on previous state
C. When state logic is complex and involves multiple sub-values
D. All of the above