From 8e8f51ad9371fc36242219db73b46af3ebbc1671 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 7 Mar 2023 11:58:18 +0000 Subject: [PATCH] feat: add the 'unstable_reactLegacyComponentNames' field to iOS project config (#1859) Co-authored-by: Riccardo Cipolleschi --- docs/projects.md | 15 ++++++++++++++- packages/cli-config/src/schema.ts | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/projects.md b/docs/projects.md index 29b4b6d5f..d9d21196a 100644 --- a/docs/projects.md +++ b/docs/projects.md @@ -64,6 +64,7 @@ The following settings are available on iOS and Android: ```ts type IOSProjectParams = { sourceDir?: string; + unstable_reactLegacyComponentNames?: string[] | null; }; type AndroidProjectParams = { @@ -81,6 +82,18 @@ type AndroidProjectParams = { A path to a directory where iOS source files are located. In most cases, you shouldn't need to set it, unless you have multiple `Podfile` files in your project. +#### project.ios.unstable_reactLegacyComponentNames + +> Note: Only applicable when new architecture is turned on. + +Please note that this is part of the **Unstable Fabric Interop Layer**, and might be subject to breaking change in the future, +hence the `unstable_` prefix. + +An array with a list of Legacy Component Name that you want to be registered with the Fabric Interop Layer. +This will allow you to use libraries that haven't been migrated yet on the New Architecture. + +The list should contain the name of the components, as they're registered in the ViewManagers (i.e. just `"Button"`). + #### project.android.appName A name of the app in the Android `sourceDir`, equivalent to Gradle project name. By default it's `app`. @@ -109,7 +122,7 @@ Please note that this is part of the **Unstable Fabric Interop Layer**, and migh hence the `unstable_` prefix. An array with a list of Legacy Component Name that you want to be registered with the Fabric Interop Layer. -This will allow you to use on the New Architecture, libreries that are legacy and haven't been migrated yet. +This will allow you to use libraries that haven't been migrated yet on the New Architecture. The list should contain the name of the components, as they're registered in the ViewManagers (i.e. just `"Button"`). diff --git a/packages/cli-config/src/schema.ts b/packages/cli-config/src/schema.ts index 0af02626f..5a7434c50 100644 --- a/packages/cli-config/src/schema.ts +++ b/packages/cli-config/src/schema.ts @@ -150,6 +150,10 @@ export const projectConfig = t // IOSProjectParams .object({ sourceDir: t.string(), + unstable_reactLegacyComponentNames: t + .array() + .items(t.string()) + .default([]), }) .default({}), android: t