Why React Hooks Changed the Way We Write Components

By Admin16 jul 2026

Why React Hooks Changed the Way We Write Components

If you've been writing React for a while, you probably remember the days of class components, this.setState(), and lifecycle methods scattered across componentDidMount and componentDidUpdate. Hooks, introduced in React 16.8, changed all of that by letting you use state and other React features directly inside function components.

What Problem Do Hooks Solve

Before hooks, sharing logic between components often meant reaching for patterns like higher-order components or render props—both of which could make your component tree hard to read. Hooks solve this by letting you extract logic into reusable functions without changing your component hierarchy at all.

Core Hooks Worth Knowing

  1. useState: manages local state in a function component.
  2. useEffect: handles side effects like data fetching, subscriptions, or manually changing the DOM.
  3. useContext: reads values from React context without wrapping your component in a consumer.
  4. useRef: holds a mutable value that doesn't trigger a re-render when changed.
  5. useMemo and useCallback: memoize values and functions to avoid unnecessary recalculation