React - propTypes -> Can't find variable: require

React - propTypes -> Can't find variable: require
0

#1

Hi guys,

I don’t know what’s wrong with my code, but somehow, I’ll always get the error “can’f find variable: require”

Here’s the code:

import React, { PropTypes } from 'react';

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 />
  }
};

Thank you in advance for your help!


#2

Fixed it with resetting and removing:

import React, { PropTypes } from 'react';