Skip to content

Commit 63a7b1d

Browse files
authored
Fix NaN in previous value (#769)
1 parent dca097e commit 63a7b1d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/inputs/reactHookForm/utils/HelperPreviousValue.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ export function HelperPreviousValue({
2727

2828
// this is not a real TS check as (previousValue === undefined)
2929
// but prevent some bypassed TS checks from a parent which possibly sends null
30-
if ((!previousValue && previousValue !== 0) || Number.isNaN(previousValue)) {
30+
if (
31+
(!previousValue && previousValue !== 0) ||
32+
Number.isNaN(previousValue) ||
33+
previousValue === 'NaN' /* TODO to remove when network-map-server never return string 'NaN' */
34+
) {
3135
return undefined;
3236
}
3337

0 commit comments

Comments
 (0)