What are some differences between props and state?

Question

In the context of this exercise, what are some differences between props and state?

Answer

There are several differences between props and state of a React component, and a few important distinctions are as follows.

Props are data and event handlers that are passed from parent to child components. They cannot be changed once they are passed.

State is similar to props, but components have their own state which they store and control. State is managed completely within the component and can change over time. Typically, the state of a component is passed to its children components and become the children’s props.

1 Like