Stateful and Stateless Components

  • A Stateful component is a component that manages state either by using useState hook or by class-based approach with the state property.
  • In state & props article, Person is a stateless component because it has no internal state management and App is a stateful component as it is managing internal state.
  • It is a good practice to use stateless component as much as possible to manage the states. By doing this, you will also have a clear flow of data and you will have a place where main logic resides and where the data changes.
  • Stateless components are also called as dumb or presentational component as they generally get the external data and preset it in a structured way and don’t have any logic in that.
  • Stateful components are also called as smart or container components as they contain the state of the application in any form.
Power Platform Academy

Start or Upgrade your Career with Power Platform

Learn with Akanksha

Python | Azure | AI/ML | OpenAI | MLOps

Design a site like this with WordPress.com
Get started