21.
Which of the following is true about the useState() hook in React?
It can only be used in class components.
It can be used multiple times within a single functional component.
It can only be used for primitive data types like string or number.
It is used for handling asynchronous operations.
Correct: B
The useState() hook can be used multiple times within a single functional component in React. This allows us to declare and manage multiple state variables within the same component. It's a powerful tool that enables us to have multiple independent states in a functional component.