The react project cannot be compiled in the past, 'propTypes' is not defined no-undef

problem description

report "propTypes" is not defined no-undef error

the environmental background of the problems and what methods you have tried

installed propTypes, is also introduced, but I don"t know why I reported this error

related codes

/ / Please paste the code text below (do not replace the code with pictures)
import React from "react";
import {HashRouter as Router, Route, Switch, Redirect} from" react-router-dom";
import {hashHistory} from "react-router";
import NotFound from". / components/pages/NotFound";
import App from". / App";
import PropTypes from "prop-types";
import {connect} from" react-redux";
import {initMenu} from". / store/index/action"

class Page extends React.Component {

static propTypes = {
    initMenu: PropTypes.func
}
constructor(props){
    super(props);
    this.state={
        path: "/app/realtime/survey"
    }
}

what result do you expect? What is the error message actually seen?

Jul.22,2021

write

outside the Page class
  https://reactjs.org/docs/type.

Menu