Tell us what’s happening:
Describe your issue in detail here.
It still say that I need to
The
ShoppingCart
component should render. The
Items
component should render.
ReferenceError: require is not defined
Your code so far
import PropTypes from 'prop-types';
const Items = (props) => {
return <h1>Current Quantity of Items in Cart: {props.quantity}</h1>
};
Items.defaultProps = {
quantity: 0
};
Items.propTypes = {
quantity: PropTypes.number.isRequired
};
class ShoppingCart extends React.Component {
constructor(props) {
super(props);
}
render() {
return <Items />
}
};
ReactDOM.render(<ShoppingCart />, document.getElementById('root'));
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0
Challenge: React - Use PropTypes to Define the Props You Expect
Link to the challenge: