26.
What are hooks in React used for?
To manage state within functional components
To handle side effects within functional components
To access React's lifecycle methods within functional components
To create class components in React
Correct: A, B
Hooks in React are used to manage state and handle side effects within functional components. They allow you to add stateful logic to functional components, which were previously only possible with class components. Hooks provide a cleaner and more intuitive way to work with state and other React features.