Why doesn't my code pass tests?

Tell us what’s happening:

Your code so far

const Items = (props) => {
return <h1>Current Quantity of: {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) {
render() {
  return <Items />

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 6.0.1; SM-N910C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Mobile Safari/537.36.

Challenge: Use PropTypes to Define the Props You Expect

Link to the challenge:

Hi @Brightside9, when you are defining which props are required and of what type they are, you should use PropTypes (with a capital P).

MyComponent.propTypes = { handleClick: PropTypes.func.isRequired }

1 Like

Thank you @simonebogni. It gets harder to notice such differences when i’m tired. Thanks again