Skip to content

Commit

Permalink
fix[devtools]: display NaN as string in values (facebook#26947)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
hoxyq authored and AndyPengc12 committed Apr 15, 2024
1 parent c73ef7c commit 9bda151
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ export default function KeyValue({
displayValue = 'null';
} else if (value === undefined) {
displayValue = 'undefined';
} else if (isNaN(value)) {
displayValue = 'NaN';
}

let shouldDisplayValueAsLink = false;
Expand Down

0 comments on commit 9bda151

Please sign in to comment.