Tell us what’s happening:
When I run my code, my console give me an error that
Uncaught ReferenceError: React is not defined
Then I added react by :
import React from 'react’
Now console error changed to :
Uncaught ReferenceError: require is not defined
Your code so far
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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.100 Safari/537.36.
Challenge: Use PropTypes to Define the Props You Expect
Link to the challenge:
https://www.freecodecamp.org/learn/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect

I just solved this issue by disabling Pi-hole on my raspberry pi.