Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

In React, how are form elements typically handled?
A. Using uncontrolled components with refs
B. Using both
C. Using controlled components where state manages the value
D. Only with native DOM
Direction: Choose the correct option

Q2.

What is a controlled component?
A. A component that cannot be changed
B. A component that controls its parent
C. A component with a controller
D. An input element whose value is controlled by React state
Direction: Choose the correct option

Q3.

How do you handle multiple input elements in a form?
A. Use global variables
B. Use refs
C. Use a single state object and handle changes with a generic change handler using name attribute
D. Use a separate state for each
Direction: Choose the correct option

Q4.

What is the purpose of the onSubmit event on a form?
A. To submit data
B. To handle form submission and prevent default behavior
C. To reset the form
D. To validate inputs
Direction: Choose the correct option

Q5.

In a controlled component, what happens when the user types in an input?
A. The input is locked
B. Nothing
C. The onChange handler updates state, and the input re-renders with new value
D. The DOM updates directly