BigInt is not supported in React Native

Viewed 1599

When I use BigInt in RN app I get this error:

Can't find variable: BigInt

How can I use BigInt in RN project?

1 Answers

I was able to resolve this issue by installing the big-integer package and implementing a simple polyfill using it:

if (typeof BigInt === 'undefined') {
    global.BigInt = require('big-integer');
}
Related