diff --git a/index.js b/index.js index 2d2c9ca447..1a6b219640 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ * @format */ +import 'platform/polyfills' import {AppRegistry} from 'react-native' import App from './src/App' import {name as appName} from './src/app.json' diff --git a/index.web.js b/index.web.js index 5154bfa7b3..f443dbb6d2 100644 --- a/index.web.js +++ b/index.web.js @@ -1,5 +1,6 @@ // index.web.js +import 'platform/polyfills' import {AppRegistry} from 'react-native' import App from './src/App' import {name as appName} from './src/app.json' diff --git a/src/platform/polyfills.native.ts b/src/platform/polyfills.native.ts deleted file mode 100644 index 26a535cca3..0000000000 --- a/src/platform/polyfills.native.ts +++ /dev/null @@ -1 +0,0 @@ -import '@zxing/text-encoding' // TextEncoder / TextDecoder diff --git a/src/platform/polyfills.ts b/src/platform/polyfills.ts index ac31e55efc..336ce12bb9 100644 --- a/src/platform/polyfills.ts +++ b/src/platform/polyfills.ts @@ -1,2 +1 @@ -// do nothing export {} diff --git a/src/platform/polyfills.web.ts b/src/platform/polyfills.web.ts new file mode 100644 index 0000000000..7a42f4887c --- /dev/null +++ b/src/platform/polyfills.web.ts @@ -0,0 +1,4 @@ +/// + +// @ts-ignore whatever typescript wants to complain about here, I dont care about -prf +window.setImmediate = (cb: () => void) => setTimeout(cb, 0)