'Proptypes' is not defined

前端 未结 7 853
面向向阳花
面向向阳花 2020-12-30 20:39

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 fo

7条回答
  •  时光取名叫无心
    2020-12-30 21:31

    You can place the PropTypes just after the class (outside the class):

    Routers.propTypes = {
       history: PropTypes.object.isRequired
    }
    

提交回复
热议问题