useState
useState is a React Hook that provides a function component with a state value and a function for updating it.
React Quickly, Second Edition
useState is a React Hook function that initializes component state and returns its current value together with a function for updating it.
- How it is used
- Makes functional components interactive by retaining local values and updating the displayed UI through setters.
- How deep it goes
- Works through initialization, destructuring, setter forms, hook ordering, and multiple states, then points to more advanced state-management approaches.
- Examples
- Uses a click counter, differently initialized counters, a filtered to-do list, and an email input updated from a property.
- What you can do after
- Build it from scratch in a functional component to initialize, display, and update local UI state.
React Hooks in Action: With Suspense and Concurrent Mode
useState is a React Hook that adds a state value and its state-updating function to a function component.
- How it is used
- Manages local component values and synchronizes rendered UI with user-driven state changes.
- How deep it goes
- Explains initialization, replacement, functional updates, object copying, multiple calls, and lifted state, without descending into React internals.
- Examples
- Uses BookablesList selection, group drop-downs, next-item navigation, counters, and parent-managed selected bookables.
- What you can do after
- Build stateful function components, update values from events, preserve prior object properties, and share state through props.
Read how React Hooks in Action: With Suspense and Concurrent Mode explains useState →
React in Depth
useState is a React hook that adds a state value and its updater function to a function component.
- How it is used
- Uses useState for component state in forms and as a baseline for application data distributed through context.
- How deep it goes
- Works through initializer inference, union and collection types, setter errors, and application-level placement, without detailing hook internals.
- Examples
- Uses an appointment response, a tag form, a goal tracker, and a dark-mode inspector session.
- What you can do after
- Apply it via React useState with explicit TypeScript types when initial values omit valid future states.
Acing the Frontend Interview
useState is a React Hook that adds a state value and its updater to a functional component.
- How it is used
- Uses useState to manage localized component state with minimal overhead in smaller React applications.
- How deep it goes
- Defines useState’s role and decision boundaries but stops short of hook syntax, update mechanics, and implementation internals.
- Examples
- Uses localized state, prop drilling, Context API, and a progression from built-in tools to Redux or Zustand as comparison examples.
- What you can do after
- Apply useState to localized state and evaluate when useReducer, Context API, Redux, or Zustand better fit the application.
Also covered in
What to know first
- class componentA class component is a user-interface component implemented as a class that defines or supplies its state, behavior, rendering, or lifecycle.
- componentA software component is a modular part of a software system that encapsulates related functionality and interacts with other parts through defined boundaries.
- Document Object ModelThe Document Object Model is a platform-independent programming interface that represents a document as a structured tree of nodes and provides ways to access and modify its content and structure.
- stateState is information describing the condition or configuration of a system or computation at a particular time that may influence its behavior or subsequent transitions.
Related concepts
- React hookkind of · A React Hook is a function-based API that enables function components to access state, effects, context, and other React capabilities.
- componentused by · A software component is a modular part of a software system that encapsulates related functionality and interacts with other parts through defined boundaries.
- stateproduces · State is information describing the condition or configuration of a system or computation at a particular time that may influence its behavior or subsequent transitions.
- reduction operationalternative to · A reduction operation combines multiple input values according to a rule to produce fewer results, often a single aggregate.
- arrayproduces · An array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
Questions about useState
What is useState?
useState is a React Hook that provides a function component with a state value and a function for updating it.
Which Manning books explain useState?
React Quickly, Second Edition, React Hooks in Action: With Suspense and Concurrent Mode, React in Depth and Acing the Frontend Interview.
What should I know before learning useState?
Manning books that teach useState usually introduce class component, component, Document Object Model and state first.
What is the difference between useState and reduction operation?
useState is a React Hook that provides a function component with a state value and a function for updating it. A reduction operation combines multiple input values according to a rule to produce fewer results, often a single aggregate.
What is useState a kind of?
useState is a kind of React hook. A React Hook is a function-based API that enables function components to access state, effects, context, and other React capabilities.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



