From 04dcb7dcf49cc98ac0c26a4ec00be669a946f152 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Fri, 9 Jan 2026 21:42:02 -0600 Subject: [PATCH] Improve monitor shouldComponentUpdate - did not tell apart 0 and -0 - would always re-render if value was NaN --- src/containers/monitor.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/containers/monitor.jsx b/src/containers/monitor.jsx index dd0dae8b5..bae60132d 100644 --- a/src/containers/monitor.jsx +++ b/src/containers/monitor.jsx @@ -91,7 +91,8 @@ class Monitor extends React.Component { for (const key of Object.getOwnPropertyNames(nextProps)) { // Don't need to rerender when other monitors are moved. // monitorLayout is only used during initial layout. - if (key !== 'monitorLayout' && nextProps[key] !== this.props[key]) { + // Using Object.is to tell apart 0 and -0 and avoid unnecessary re-renders for NaN + if (key !== 'monitorLayout' && !Object.is(nextProps[key], this.props[key])) { return true; } }