-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Get the library to work in React Native #2
Comments
Polyfilling Also (attempting to) ping @meshcollider |
Successfully got polyfills working for a react native implementation (soon to be public), based on modified code from this. Imo using a helper package is a bit clunky, but it's a possible way forward. |
Specifically: import 'text-encoding-polyfill'
global.Buffer = global.Buffer || require('buffer').Buffer
if (typeof BigInt === 'undefined') {
const bi = require('big-integer')
function myBigInt(value) {
if (typeof value === 'string') {
const match = value.match(/^0([xo])([0-9a-f]+)$/i)
if (match) {
return bi(match[2], match[1].toLowerCase() === 'x' ? 16 : 8)
}
}
return bi(value)
}
global.BigInt = myBigInt
if (process === undefined) {
process = require('process')
} else if (process.nextTick === undefined) {
process.nextTick = require('process').nextTick
}
} |
We have two React Native apps now using this package, I suggest this closes. |
Let's write down some documentation, maybe create |
Tests should pass in React Native environment
The text was updated successfully, but these errors were encountered: