I'll explain each hook and provide practical use cases for when you'd want to use them.

  1. useState
nst [count, setCount] = useState(0);

When to use:

Example usecase:

const [isMenuOpen, setIsMenuOpen] = useState(false);
const [username, setUsername] = useState('');
  1. useEffect
useEffect(() => {
// effect code
  return () => {
// cleanup code
  }
}, [dependencies]);

When to use: