I'm setting up a new React with the help of: https://github.com/facebookincubator/create-react-app
However, I'm running into a linting issue. I'm receiving the following linting error 'PropTypes' is not defined. (no-undef)
.
Here is the code that is causing the issue:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class Routers extends Component {
static propTypes = {
history: PropTypes.object.isRequired
};
...
I tried playing around with the react/prop-types rule, but to no avail.
Since react 15.5, PropTypes is included in a separate package, 'prop-types'. So this line will help
import PropTypes from 'prop-types'
You can read more here