Override Default Props: What's wrong?

Hey all, having trouble with the challenge below. Any ideas what i’m doing wrong?


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={100} />
    { /* change code above this line */ }
  }
};

Link to the challenge:

You’ve overriden the default quantity to 100, but the questions wants 10. I think that’s it…

1 Like

Ha ha. That had me worrying. I’m reviewing react. :grinning:

1 Like

@Danyl007
Just wondering, would you use react to build a pomodoro clock or calculator? It seems like a lot of unnecessary complications. It also adds to load time.

Haven’t got into React yet, only had brief exposure to Angular , which I refer to as ‘the bad time’. My understanding is, the more practise you get with it the better, so I would use React, if only to get better at it. I’m hoping to do small Vue and React course over new years though. Good luck !

1 Like