When writing React components, we sometimes need access to lifecycle events to handle a variety of side effects: fetching data on mount, sanitizing props when the component updates, cleaning up before the component unmounts, etc.
Hooks significantly simplify your code, and you can use them within an existing React codebase that otherwise uses classes. And it’s easy to dive right into using hooks – until you try to test your fancy new components.