I'm getting a warning for a page that I'm not currently on(being on the https://example.com/this-page).
Warning: Failed prop type: The prop `query` is marked as required in `OtherPage`, but its value is `undefined`.
"prop-types": "^15.7", "react": "^17.0", "react-redux": "^7.2", "react-router-dom": "^6.0",
This component is used directly in the Route component
let global_props = {...}
...
<Routes>
<Route path="/this-page" exact element={<ThisPage ...{global_props}/>}/>
<Route path="/other-page" exact element={<OtherPage ...{global_props}/>}/>
</Routes>
Here's the component. Note, it's not using redux at the moment.
import React, {Component} from 'react';
import PropTypes from "prop-types";
class OtherPage extends Component {
render() {
return <div>HI</div>;
}
}
OtherPage.propTypes = {
query: PropTypes.object.isRequired
};
export default OtherPage;
What would be the reason for that?
Thanks.