25.
What is the useState() hook used for in React?
To create class components
To manage state within functional components
To handle side effects within functional components
To access React's lifecycle methods within functional components
Correct: B
The useState() hook in React is used to manage state within functional components. It allows you to declare state variables and provides a function to update their values. By using the useState() hook, you can easily incorporate stateful logic into your functional components and make them more dynamic and interactive.