cleanup: silence our own React dev-console warnings
UNSAFE_ rename of our 4 componentWillReceiveProps (FireStats, Fires, FromNow, SelectionMap) and Authenticated/Public component propType func -> elementType. Rest of the console noise is legacy react-* dev-mode warnings, absent in prod.
This commit is contained in:
parent
9feaca9d0b
commit
a997aa7cae
6 changed files with 8 additions and 6 deletions
|
|
@ -17,7 +17,9 @@ const Authenticated = ({ loggingIn, authenticated, component, path, exact, ...re
|
||||||
Authenticated.propTypes = {
|
Authenticated.propTypes = {
|
||||||
loggingIn: PropTypes.bool.isRequired,
|
loggingIn: PropTypes.bool.isRequired,
|
||||||
authenticated: PropTypes.bool.isRequired,
|
authenticated: PropTypes.bool.isRequired,
|
||||||
component: PropTypes.func.isRequired,
|
// elementType (not func): route components may be HOC-wrapped (translate(),
|
||||||
|
// memo, forwardRef), which are objects, not plain functions.
|
||||||
|
component: PropTypes.elementType.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Authenticated;
|
export default Authenticated;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class FromNow extends Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.when !== nextProps.when) {
|
if (this.props.when !== nextProps.when) {
|
||||||
// console.log(`Next when ${nextProps.when}`);
|
// console.log(`Next when ${nextProps.when}`);
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ const Public = ({
|
||||||
Public.propTypes = {
|
Public.propTypes = {
|
||||||
loggingIn: PropTypes.bool.isRequired,
|
loggingIn: PropTypes.bool.isRequired,
|
||||||
authenticated: PropTypes.bool.isRequired,
|
authenticated: PropTypes.bool.isRequired,
|
||||||
component: PropTypes.func.isRequired
|
component: PropTypes.elementType.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Public;
|
export default Public;
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class SelectionMap extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||||
const nextCenter = nextProps.center[0] ? nextProps.center : this.state.center;
|
const nextCenter = nextProps.center[0] ? nextProps.center : this.state.center;
|
||||||
const nextMarker = nextProps.center[0] ? nextProps.center : this.state.marker;
|
const nextMarker = nextProps.center[0] ? nextProps.center : this.state.marker;
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Fire extends React.Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.when !== nextProps.when || this.props.loading !== nextProps.loading || this.props.notfound !== nextProps.notfound) {
|
if (this.props.when !== nextProps.when || this.props.loading !== nextProps.loading || this.props.notfound !== nextProps.notfound) {
|
||||||
// console.log(`Next when ${nextProps.when}`);
|
// console.log(`Next when ${nextProps.when}`);
|
||||||
if (nextProps.fire && (nextProps.alert || nextProps.active || nextProps.fromHash)) {
|
if (nextProps.fire && (nextProps.alert || nextProps.active || nextProps.fromHash)) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class FireStats extends Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.lastCheck !== nextProps.lastCheck ||
|
if (this.props.lastCheck !== nextProps.lastCheck ||
|
||||||
this.props.lastFireDetected !== nextProps.lastFireDetected ||
|
this.props.lastFireDetected !== nextProps.lastFireDetected ||
|
||||||
this.props.loadingAll !== nextProps.loadingAll
|
this.props.loadingAll !== nextProps.loadingAll
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue