From b4f2a6979afeeb6b0b29bbf668d61b23b65b47ec Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 23 Feb 2023 16:42:52 -0600 Subject: Add setImmediate polyfill to web, fixing dropdown items --- index.js | 1 + index.web.js | 1 + src/platform/polyfills.native.ts | 1 - src/platform/polyfills.ts | 1 - src/platform/polyfills.web.ts | 4 ++++ 5 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 src/platform/polyfills.native.ts create mode 100644 src/platform/polyfills.web.ts diff --git a/index.js b/index.js index 2d2c9ca44..1a6b21964 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 5154bfa7b..f443dbb6d 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 26a535cca..000000000 --- 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 ac31e55ef..336ce12bb 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 000000000..7a42f4887 --- /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) -- cgit 1.4.1