From 424944dbc91757aa3ddcf1567db762de7778ddd9 Mon Sep 17 00:00:00 2001 From: Bartosz Grajdek Date: Tue, 29 Aug 2023 11:46:06 +0200 Subject: [PATCH 1/2] [TS migration] Migrate 'shouldRenderOffscreen' lib to TypeScript --- src/libs/shouldRenderOffscreen/index.android.js | 2 -- src/libs/shouldRenderOffscreen/index.android.ts | 6 ++++++ src/libs/shouldRenderOffscreen/index.js | 1 - src/libs/shouldRenderOffscreen/index.ts | 5 +++++ src/libs/shouldRenderOffscreen/types.ts | 3 +++ 5 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 src/libs/shouldRenderOffscreen/index.android.js create mode 100644 src/libs/shouldRenderOffscreen/index.android.ts delete mode 100644 src/libs/shouldRenderOffscreen/index.js create mode 100644 src/libs/shouldRenderOffscreen/index.ts create mode 100644 src/libs/shouldRenderOffscreen/types.ts diff --git a/src/libs/shouldRenderOffscreen/index.android.js b/src/libs/shouldRenderOffscreen/index.android.js deleted file mode 100644 index c91ffa15894d..000000000000 --- a/src/libs/shouldRenderOffscreen/index.android.js +++ /dev/null @@ -1,2 +0,0 @@ -// Rendering offscreen on Android allows it to apply opacity to stacked components correctly. -export default true; diff --git a/src/libs/shouldRenderOffscreen/index.android.ts b/src/libs/shouldRenderOffscreen/index.android.ts new file mode 100644 index 000000000000..fef74bdf1829 --- /dev/null +++ b/src/libs/shouldRenderOffscreen/index.android.ts @@ -0,0 +1,6 @@ +import ShouldRenderOffscreen from './types'; +// Rendering offscreen on Android allows it to apply opacity to stacked components correctly. + +const shouldRenderOffscreen: ShouldRenderOffscreen = true; + +export default shouldRenderOffscreen; diff --git a/src/libs/shouldRenderOffscreen/index.js b/src/libs/shouldRenderOffscreen/index.js deleted file mode 100644 index 33136544dba2..000000000000 --- a/src/libs/shouldRenderOffscreen/index.js +++ /dev/null @@ -1 +0,0 @@ -export default false; diff --git a/src/libs/shouldRenderOffscreen/index.ts b/src/libs/shouldRenderOffscreen/index.ts new file mode 100644 index 000000000000..eadcc44814f9 --- /dev/null +++ b/src/libs/shouldRenderOffscreen/index.ts @@ -0,0 +1,5 @@ +import ShouldRenderOffscreen from './types'; + +const shouldRenderOffscreen: ShouldRenderOffscreen = false; + +export default shouldRenderOffscreen; diff --git a/src/libs/shouldRenderOffscreen/types.ts b/src/libs/shouldRenderOffscreen/types.ts new file mode 100644 index 000000000000..63cd98eec31b --- /dev/null +++ b/src/libs/shouldRenderOffscreen/types.ts @@ -0,0 +1,3 @@ +type ShouldRenderOffscreen = boolean; + +export default ShouldRenderOffscreen; From 184d2211653ab21c18dfcdb5e898b261f07f6c1b Mon Sep 17 00:00:00 2001 From: Bartosz Grajdek Date: Tue, 29 Aug 2023 13:28:34 +0200 Subject: [PATCH 2/2] Move comment --- src/libs/shouldRenderOffscreen/index.android.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/shouldRenderOffscreen/index.android.ts b/src/libs/shouldRenderOffscreen/index.android.ts index fef74bdf1829..bf2d9837086f 100644 --- a/src/libs/shouldRenderOffscreen/index.android.ts +++ b/src/libs/shouldRenderOffscreen/index.android.ts @@ -1,6 +1,6 @@ import ShouldRenderOffscreen from './types'; -// Rendering offscreen on Android allows it to apply opacity to stacked components correctly. +// Rendering offscreen on Android allows it to apply opacity to stacked components correctly. const shouldRenderOffscreen: ShouldRenderOffscreen = true; export default shouldRenderOffscreen;