My Blog

My WordPress Blog

My Blog

My WordPress Blog

Day: September 20, 2024

 What are the differences between class and functional components?

Class Components Functional Components State Can hold or manage state Cannot hold or manage state Simplicity Complex as compared to the stateless component Simple and easy to understand Lifecycle methods Can work with all lifecycle methods Does not work with any lifecycle method Reusability Can be reused Cannot be reused

What are the differences between state and props?

State Props Use Holds information about the components Allows to pass data from one component to other components as an argument Mutability Is mutable Are immutable Read-Only Can be changed Are read-only Child components Child components cannot access  Child component can access  Stateless components Cannot have state Can have props

Scroll to top