Learn Stateful and Stateless components in ReactJS

Page 1

Learn Stateful and Stateless components in ReactJS

Have you ever encountered the question of what stateful components are? What stateless components are? When should I make a component stateful or stateless?

If so, don’t worry, you’ve come to the right place. So, let’s first try to understand what state and components are before we talk about stateful vs. stateless?

State A State is an object inside the constructor method of a class which is a must in the stateful components. It is used for internal communication inside a component. It allows you to create


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Learn Stateful and Stateless components in ReactJS by Sasi Kiran - Issuu