function ParentComponent(props) {
return (
<section>
<ChildComponent name="Eric" />
<ChildComponent name="Mike" />
<ChildComponent name="Ellen" />
</section>
Β );
}
function ChildComponent(props) {
return <div>Hi {props.name}</div>;
}
The receiving [child] component cannot modify the props it was given
This means we can't ever change the way our applications looks πππ
class Counter extends React.Component { state = { counter: 0 }; // ...
this.setState({ counter: newValue });
<p>Current count: {this.state.counter}</p>
YES! π