Props Type check is failing

I tried to compare my code and it seems same and good to me but I cannot find why its not passing

The Items component should include a propTypes check that requires quantity to be a number .


const Items = (props) => {
  return <h1>Current Quantity of Items in Cart: {props.quantity}</h1>
};

// change code below this line
Items.PropTypes = {
  quantity: PropTypes.number.isRequired
},
// change code above this line

Items.defaultProps = {
  quantity: 0
};
class ShoppingCart extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return <Items />
  }
};

Your browser information:

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

hi,
do a case sensitive spell check of your code and you will spot the mistake :slight_smile:

Thanks @orvalho but it is confusing at why they would use uppercase and lower case . it is confusing if u know what I mean.

1 Like