From fb1001ce58ece6ef5fabd005090ebc29aa035ff1 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Fri, 13 May 2022 11:23:21 -0700 Subject: [PATCH] fix: remove unactionable warning when on 'Paper' (#33830) Summary: We are currently seeing warning `Native Component 'X' that calls codegenNativeComponent was not code generated at build time. Please check its definition.` even though we have not opted into Fabric. This warning is not actionable and is just noisy. See also discussion: https://github.com/reactwg/react-native-releases/discussions/21#discussioncomment-2657180 ## Changelog [General] [Fixed] - Remove unactionable warning about `codegenNativeComponent` when on 'Paper' Pull Request resolved: https://github.com/facebook/react-native/pull/33830 Test Plan: n/a Reviewed By: dmitryrykun Differential Revision: D36377844 Pulled By: cortinico fbshipit-source-id: 23c9f9dbf0ce1cea60c5dc8caa02d0dc53bd635d --- Libraries/Utilities/codegenNativeComponent.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Libraries/Utilities/codegenNativeComponent.js b/Libraries/Utilities/codegenNativeComponent.js index 4b87322d4a6..673544ad44e 100644 --- a/Libraries/Utilities/codegenNativeComponent.js +++ b/Libraries/Utilities/codegenNativeComponent.js @@ -34,15 +34,14 @@ function codegenNativeComponent( componentName: string, options?: Options, ): NativeComponentType { - const errorMessage = - "Native Component '" + - componentName + - "' that calls codegenNativeComponent was not code generated at build time. Please check its definition."; if (global.RN$Bridgeless === true) { + const errorMessage = + "Native Component '" + + componentName + + "' that calls codegenNativeComponent was not code generated at build time. Please check its definition."; console.error(errorMessage); - } else { - console.warn(errorMessage); } + let componentNameInUse = options && options.paperComponentName != null ? options.paperComponentName