Fix ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode check (#38639)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38639

`ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode` is a function, we should call it.
Changelog: [Internal] - Fix ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode check

Reviewed By: luluwu2032

Differential Revision: D47798910

fbshipit-source-id: 68c75069f400f0a0327b1c3a5dd2b1cbfc2e70c7
This commit is contained in:
Dmitry Rykun 2023-07-27 07:28:56 -07:00 committed by Facebook GitHub Bot
parent e37e53086a
commit 75b8b10765

View File

@ -31,7 +31,7 @@ function getCachedConstants(): Object {
module.exports = {
getViewManagerConfig: (viewManagerName: string): mixed => {
if (ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode) {
if (ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode()) {
return getCachedConstants()[viewManagerName];
} else {
console.error(
@ -46,7 +46,7 @@ module.exports = {
return unstable_hasComponent(viewManagerName);
},
getConstants: (): Object => {
if (ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode) {
if (ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode()) {
return getCachedConstants();
} else {
console.error(errorMessageForMethod('getConstants'));