Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is state in React?
A. Immutable data
B. Global data accessible to all components
C. Data that is passed from parent to child
D. Data that is managed within a component and can change over time
Direction: Choose the correct option

Q2.

How do you update state in a class component?
A. Directly assign this.state = newValue
B. Use this.state.update()
C. Use this.setState()
D. Use this.updateState()
Direction: Choose the correct option

Q3.

In a functional component, which hook is used to add state?
A. useEffect
B. useState
C. useReducer
D. useContext
Direction: Choose the correct option

Q4.

What happens when state changes?
A. The component re-renders
B. Nothing
C. The props are updated
D. The component unmounts
Direction: Choose the correct option

Q5.

Can state be accessed directly in a class component?
A. Yes, via this.state
B. Yes, via this.data
C. Only after componentDidMount
D. No, only via getState()