Override Default Props - braces around quantity

Override Default Props - braces around quantity
0

#1

Your code so far


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.props = quantity:{10}/>
    { /* change code above this line */ }
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/override-default-props


#2

They gave you a clue which was to use the same syntax to set the property as you would if it was an html attribute.
So for eg. In real html, if we had an attribute called quantity we would have written this

<item quantity=10></item>

So that is their hint… does seeing it now help you? (This is my hint)


#3

Yes! Thank you! Removing the props was key.