Difference between props and state? Facebook ReactJS Interview Question

While a component has information from both its props and its state, props are immutable and owned by a component's parent, whereas state is mutable and owned by the component. this.state is private to the component and can be updated with this.setState(). As with props, when the state updates the component will re-render itself.

Comments

Contact Form

Send