It is not clear which section a default prop would be set in this example. Besides, there is not a line that sets the default prop to 0.
const Items = (props) => {
return <h1>Current Quantity of Items in Cart: {props.quantity}</h1>
}
Items.defaultProps = {
quantity: 0
}
class ShoppingCart extends React.Component {
constructor(props) {
super(props);
}
render() {
{ /* Change code below this line */ }
return <Items quantity={10} />
//Would this go here?
//const defaultProps = {quantity: 0};
{ /* Change code above this line */ }
}
};
Challenge: Override Default Props
Link to the challenge: