trying to use BigInt in a project, but this doesn't work as expected on android as the data type returned is object
, but when debugger mode is turned on, data type is bigint
const getBigIntType = () => {
/**
* This returns object on android on release build or without
debugger mode, but bigint when debugger is enabled
* on iOS, it returns bigint on both modes
*/
return typeof BigInt(10);
};
I created a repo to replicate this issue, also outlined other modules I've tried to get this to work. Kindly find the link here https://github.com/Balanced02/BigIntIssue.
Created an issue on react-native's github page also on this link https://github.com/facebook/react-native/issues/32820
To give a bit background information.
The usage of native BigInt is not working for android in production mode. However, it's working on ios.
Since it is working in browser/node.js environment, we suspect it could be an issue with react native android.
We tried to finding the solution via official documentation and google, we haven't find any solution so far.
Any help is highly appreciated. :pray:
Update: React-Native v0.70.0 supports BigInt natively when using the hermes library