Get a free consultation
ReactJS Development

React Hooks (useState, useEffect, useContext, etc.)

By Sigmato Editorial TeamUpdated 14 Nov 20261 min read

React Hooks are functions that let functional components use state and lifecycle features. They were introduced in React 16.8 so that developers can use state and other React features without writing a class. Commonly used React Hooks include useState, useEffect, useContext and more. Here is a brief overview of each:

  1. useState:

    • useState adds state to functional components.
    • It returns an array with two elements: the current state value and a function that lets you update it.
useState hook example

2. useEffect:

  • useEffect handles side effects in functional components, such as data fetching, subscriptions or manually changing the DOM.
  • It takes a function containing the code to run and an optional array of dependencies.
useEffect hook example

3. useContext:

  • useContext subscribes to React context without introducing nesting.
  • It takes a context object (the value returned from React.createContext) and returns the current context value for that context.
useContext hook example

These are just a few of the many hooks provided by React. Others include useReducer, useCallback, useMemo, useRef and more. Hooks provide a more straightforward, functional approach to managing state and side effects in React components.

Sigmato Editorial Team

Written by

Sigmato Editorial Team

The Sigmato Editorial Team is made up of software engineers, UI/UX designers and AI specialists at Sigmato Solutions Pvt Ltd in Bengaluru, India and the UK. We write practical guides on web, mobile, cloud and AI development, drawing on the products we design and build for startups and enterprises worldwide.

Last updated 14 November 2026 · Talk to our team