React hooks are functions that allow you to use state and other React features in function components.
They were introduced to solve problems with class components like complex logic reuse and confusing lifecycle methods.
Hooks make it easier to share stateful logic between components, avoid complex patterns like render props and HOCs, and make components more readable.
// useState hook const [state, setState] = useState(initialValue);
// useEffect hook useEffect(() => { // Side effect code return () => { // Cleanup code }; }, [dependencies]);