Differentiate between States and Props.
The major differences between States and Props are given below.
| SN | Props | State |
|---|---|---|
| 1. | Props are read-only. | State changes can be asynchronous. |
| 2. | Props are immutable. | State is mutable. |
| 3. | Props allow you to pass data from one component to other components as an argument. | State holds information about the components. |
| 4. | Props can be accessed by the child component. | State cannot be accessed by child components. |
| 5. | Props are used to communicate between components. | States can be used for rendering dynamic changes with the component. |
| 6. | The stateless component can have Props. | The stateless components cannot have State. |
| 7. | Props make components reusable. | The State cannot make components reusable. |
| 8. | Props are external and controlled by whatever renders the component. | The State is internal and controlled by the component itself. |
