What does it mean that props can only be changed by a different component?

Question

What does it mean that props “can only be changed by a different component?”

Answer

Once a component receives props, those props cannot be changed by it. Only the parent component which sent the props, or some component that is an ancestor of the child component receiving the props, is able to change the value to something else.

The parent component may change its state at times, and this can trigger a re-render of the child component receiving the props, with new values.

1 Like