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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b12c-2afa9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b12c-2afa9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?