ReactJS Hooks Reference Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 15 Likes Like Report React hooks are functions that allow you to use state and other React features in functional components. Hooks were introduced in React 16.8, enabling developers to manage state and lifecycle features without needing class components. They simplify the development process and make it easier to write reusable and cleaner code.Below is the basic representation of the React JS Hooks useState. CSS /* Write CSS Here */ .App { display: flex; flex-direction: column; justify-content: center; align-items: center; } body { background-color: antiquewhite; } .App>h2 { text-align: center; } .App>button { width: 8rem; font-size: larger; padding: 2vmax auto; height: 1.8rem; color: white; background-color: rgb(34, 34, 33); border-radius: 10px; } button:hover { background-color: rgb(80, 80, 78); } JavaScript import React, { useState } from 'react'; import './App.css' const App = () => { const [num, setNum] = useState(0); const handleClick = () => { setNum(num + 1); }; return ( <div className="App"> <h2> {num}</h2> <button onClick={handleClick}> Add one </button> </div> ); }; export default App; The useState hook is used to create a num state, initialized to 0, and a setNum function to update it when the button is clicked.The handleClick function increments num by 1 each time the button is clicked, updating the displayed value in the <h2> tag.OutputWhy Use React Hooks?Simplifies Code: Hooks provide a simpler and cleaner way to write components by using functions instead of classes.State and Side Effects: Hooks allow you to use state (useState) and side effects (useEffect) in functional components.Reusability: Hooks make it easier to share logic across components by creating custom hooks.Readability: Functional components with hooks tend to be more concise and easier to read than class components.Different Hooks in ReactuseState: useState is used to add state to functional components.useEffect: useEffect is used to perform side effects (like fetching data or subscribing to services) in functional components.useContext: useContext allows you to access the value of a context in functional components.useReducer: useReducer is an alternative to useState for more complex state logic.useRef: useRef returns a mutable ref object which can be used to reference DOM elements or store mutable values.useMemo: useMemo is used to memoize values or computations to prevent expensive calculations on every render.useCallback: useCallback is used to memoize functions so that they are not recreated on every render.useLayoutEffect: Similar to useEffect, but it runs synchronously after all DOM mutations, allowing you to perform operations on the layout.useImperativeHandle: useImperativeHandle customizes the instance value that is exposed when using ref in functional components.Advantages of Using HooksCleaner Code: Hooks make code simpler and easier to read by allowing state and effects to be used directly in functional components.Better Reusability: Custom hooks allow the reuse of logic across different components.No this keyword: Hooks eliminate the need for the this keyword found in class components, reducing complexity and mistakes.More Functionality in Functional Components: Previously, only class components could use lifecycle methods and state. Now, with hooks, even functional components can manage state, side effects, and other features.React JS Hooks ReferenceuseState HookuseEffect HookuseRef HookuseMemo HookuseContext HookuseReducer HookuseHistory HookuseNavigate HookuseParams HookuseLayoutEffect HookuseImperativeHandle HookuseDebugValue HookuseUndoState HookuseSelect HookuseCallback HookuseTransition HookuseId HookuseInsertionEffect HookReactJS Custom HooksuseLocalStorage Custom HookuseForm Custom HookuseTimeout Custom HookuseOrientation Custom HookuseInterval Custom Hook Create Quiz Comment K kartik Follow 15 Improve K kartik Follow 15 Improve Article Tags : Web Technologies ReactJS React-Hooks Explore React FundamentalsReact Introduction6 min readReact Environment Setup3 min readReact JS ReactDOM2 min readReact JSX5 min readReactJS Rendering Elements3 min readReact Lists4 min readReact Forms4 min readReactJS Keys4 min readComponents in ReactReact Components4 min readReactJS Functional Components4 min readReact Class Components3 min readReactJS Pure Components4 min readReactJS Container and Presentational Pattern in Components2 min readReactJS PropTypes5 min readReact Lifecycle7 min readReact HooksReact Hooks8 min readReact useState Hook5 min readReactJS useEffect Hook5 min readRouting in ReactReact Router5 min readReact JS Types of Routers10 min read Advanced React ConceptsLazy Loading in React and How to Implement it ?4 min readReactJS Higher-Order Components5 min readCode Splitting in React4 min readReact ProjectsCreate ToDo App using ReactJS3 min readCreate a Quiz App using ReactJS4 min readCreate a Coin Flipping App using ReactJS3 min readHow to create a Color-Box App using ReactJS?4 min readDice Rolling App using ReactJS4 min readGuess the number with React3 min read Like