fix[devtools]: display NaN as string in values (#26947)
## Summary >Warning: Received NaN for the `children` attribute. If this is expected, cast the value to a string. Fixes this warning, when we try to display NaN as NaN in key-value list.
Ruslan Lesiutin committed
Jun 14, 2023 at 11:45 UTC
f5c249db8b0bec00faa9633d67814e980c24fbb5
1 file changed
+2
packages/react-devtools-shared/src/devtools/views/Components/KeyValue.js
+2
@@ -255,6 +255,8 @@ export default function KeyValue({
255
displayValue = 'null';
256
} else if (value === undefined) {
257
displayValue = 'undefined';
258
+ } else if (isNaN(value)) {
259
+ displayValue = 'NaN';
260
}
261
262
let shouldDisplayValueAsLink = false;