props, and return a hierarchy of views to display via Render methodstate, which shoule be considered as private member
set by this.setState({<state name>: <state value>})class ShoppingList extends React.Component {
render() {
return (
<div className="shopping-list">
<h1>Shopping List for {this.props.name}</h1>
<ul>
<li>Instagram</li>
<li>WhatsApp</li>
<li>Oculus</li>
</ul>
</div>
);
}
}
// Example usage: <ShoppingList name="Mark" />
statefunction Square(props) {
return (
<button className="square" onClick={props.onClick}>
{props.value}
</button>
);
}
Return a description of waht you want to see on the screen