Sunday, 6 October 2024

React props Vs State

 

PROPS

STATE

The Data is passed from one component to another.

The Data is passed within the component only.

It is Immutable (cannot be modified).

It is Mutable ( can be modified).

Props can be used with state and functional components.

The state can be used only with the state components/class component (Before 16.0).

Props are read-only.

The state is both read and write.

No comments:

Post a Comment