I'll explain each hook and provide practical use cases for when you'd want to use them.
nst [count, setCount] = useState(0);
When to use:
Example usecase:
const [isMenuOpen, setIsMenuOpen] = useState(false);
const [username, setUsername] = useState('');
useEffect(() => {
// effect code
return () => {
// cleanup code
}
}, [dependencies]);
When to use: