Skip to content

Commit

Permalink
fix: remove unactionable warning when on 'Paper' (#33830)
Browse files Browse the repository at this point in the history
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: reactwg/react-native-releases#21 (comment)

## Changelog

[General] [Fixed] - Remove unactionable warning about `codegenNativeComponent` when on 'Paper'

Pull Request resolved: #33830

Test Plan: n/a

Reviewed By: dmitryrykun

Differential Revision: D36377844

Pulled By: cortinico

fbshipit-source-id: 23c9f9dbf0ce1cea60c5dc8caa02d0dc53bd635d
  • Loading branch information
tido64 authored and facebook-github-bot committed May 13, 2022
1 parent e3a0eea commit 494b73c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Libraries/Utilities/codegenNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 494b73c

Please sign in to comment.