From a997aa7cae6980dcbdb2e248d5f9deeadec74388 Mon Sep 17 00:00:00 2001 From: vjrj Date: Sat, 18 Jul 2026 05:47:44 +0200 Subject: [PATCH] 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. --- imports/ui/components/Authenticated/Authenticated.js | 4 +++- imports/ui/components/FromNow/FromNow.js | 2 +- imports/ui/components/Public/Public.js | 2 +- imports/ui/components/SelectionMap/SelectionMap.js | 2 +- imports/ui/pages/Fires/Fires.js | 2 +- imports/ui/pages/FiresMap/FireStats.js | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/imports/ui/components/Authenticated/Authenticated.js b/imports/ui/components/Authenticated/Authenticated.js index f34da2f..cfe1a69 100644 --- a/imports/ui/components/Authenticated/Authenticated.js +++ b/imports/ui/components/Authenticated/Authenticated.js @@ -17,7 +17,9 @@ const Authenticated = ({ loggingIn, authenticated, component, path, exact, ...re Authenticated.propTypes = { loggingIn: 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; diff --git a/imports/ui/components/FromNow/FromNow.js b/imports/ui/components/FromNow/FromNow.js index 945b13d..9e61f32 100644 --- a/imports/ui/components/FromNow/FromNow.js +++ b/imports/ui/components/FromNow/FromNow.js @@ -18,7 +18,7 @@ class FromNow extends Component { }; } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { if (this.props.when !== nextProps.when) { // console.log(`Next when ${nextProps.when}`); this.setState({ diff --git a/imports/ui/components/Public/Public.js b/imports/ui/components/Public/Public.js index 202b59e..a708408 100644 --- a/imports/ui/components/Public/Public.js +++ b/imports/ui/components/Public/Public.js @@ -21,7 +21,7 @@ const Public = ({ Public.propTypes = { loggingIn: PropTypes.bool.isRequired, authenticated: PropTypes.bool.isRequired, - component: PropTypes.func.isRequired + component: PropTypes.elementType.isRequired }; export default Public; diff --git a/imports/ui/components/SelectionMap/SelectionMap.js b/imports/ui/components/SelectionMap/SelectionMap.js index 0d0f30d..da18527 100644 --- a/imports/ui/components/SelectionMap/SelectionMap.js +++ b/imports/ui/components/SelectionMap/SelectionMap.js @@ -60,7 +60,7 @@ class SelectionMap extends Component { } } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { const nextCenter = nextProps.center[0] ? nextProps.center : this.state.center; const nextMarker = nextProps.center[0] ? nextProps.center : this.state.marker; this.setState({ diff --git a/imports/ui/pages/Fires/Fires.js b/imports/ui/pages/Fires/Fires.js index 7790aeb..17873e2 100644 --- a/imports/ui/pages/Fires/Fires.js +++ b/imports/ui/pages/Fires/Fires.js @@ -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) { // console.log(`Next when ${nextProps.when}`); if (nextProps.fire && (nextProps.alert || nextProps.active || nextProps.fromHash)) { diff --git a/imports/ui/pages/FiresMap/FireStats.js b/imports/ui/pages/FiresMap/FireStats.js index a4742ef..5f7a00a 100644 --- a/imports/ui/pages/FiresMap/FireStats.js +++ b/imports/ui/pages/FiresMap/FireStats.js @@ -17,7 +17,7 @@ class FireStats extends Component { }; } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { if (this.props.lastCheck !== nextProps.lastCheck || this.props.lastFireDetected !== nextProps.lastFireDetected || this.props.loadingAll !== nextProps.loadingAll