Question 4 of 10Pro Only
Explain the useState and useEffect hooks. What problems do they solve?
Sample answer preview
## useState Hook useState allows **function components to have state**. Before hooks, only class components could manage state. ```javascript import { useState } from 'react'; function Counter() { // Declare state variable 'count' with initial value 0 const [count, setCount] =…
useStateuseEffectside effectsdependency arraycleanup functionstate management