react hooks why does usestate take in a function code example
Example 1: how to use hooks react
const App = () => {
const [students , setStudents] = useState([]);
return (
// put in the jsx code here
)
}
Example 2: usestate
const [count, setCount] = useState(0);