Table of Contents

React - Local component state (known as State)

About

This page is about the local state of a component.

In React, this local state is known as state

Usage

State value persistence

If you need to persist local state, you should:

In React apps, whether a component is stateful or stateless is considered an implementation detail of the component that may change over time. You can use stateless components inside stateful components, and vice versa.

How to persist the local state between rendering?

See the dedicated page: React - How to persist the local state between rendering without any library? (custom useState Hook)

State by component type

Check the dedicated page: