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
This commit is contained in:
Tommy Nguyen
2022-05-13 11:23:21 -07:00
committed by fortmarek
parent f811da7cc2
commit fb1001ce58
@@ -34,15 +34,14 @@ function codegenNativeComponent<Props>(
componentName: string,
options?: Options,
): NativeComponentType<Props> {
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