Skip to content

Commit dab9f1b

Browse files
committed
fix: check bigint in serializeToString and change it to string
1 parent 38cd758 commit dab9f1b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/react-devtools-shared/src/backend/utils.js

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export function serializeToString(data: any): string {
8181
}
8282
cache.add(value);
8383
}
84+
// $FlowFixMe
85+
if (typeof value === 'bigint') {
86+
return value.toString() + 'n';
87+
}
8488
return value;
8589
});
8690
}

packages/react-devtools-shell/src/app/InspectableElements/UnserializableProps.js

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const immutable = Immutable.fromJS({
3131
xyz: 1,
3232
},
3333
});
34+
// $FlowFixMe
35+
const bigInt = BigInt(123); // eslint-disable-line no-undef
3436

3537
export default function UnserializableProps() {
3638
return (
@@ -43,6 +45,7 @@ export default function UnserializableProps() {
4345
setOfSets={setOfSets}
4446
typedArray={typedArray}
4547
immutable={immutable}
48+
bigInt={bigInt}
4649
/>
4750
);
4851
}

0 commit comments

Comments
 (0)