From 9670bde5abf0e3156f60fe9db3a0a6b005df3611 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 10 Jan 2024 07:01:22 -0800 Subject: [PATCH] BridgelessUIManager: Improve error message for getViewManagerConfig() (#41998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41998 Now the error message propts people to turn on the interop layer. And, it adds more details to the suggestion to use hasViewManager(viewManagerName). Changelog: [Internal] Reviewed By: cortinico Differential Revision: D52002909 fbshipit-source-id: 80ea60b4f6a5fe15d773bb1f3f41de5ce43d6652 --- .../react-native/Libraries/ReactNative/BridgelessUIManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js b/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js index eb226f01702..f626478e4f1 100644 --- a/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js +++ b/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js @@ -182,8 +182,8 @@ const UIManagerJS: UIManagerJSInterface & {[string]: any} = { return getUIManagerConstantsCache()[viewManagerName]; } else { raiseSoftError( - 'getViewManagerConfig', - `Use hasViewManagerConfig instead. viewManagerName: ${viewManagerName}`, + `getViewManagerConfig('${viewManagerName}')`, + `If '${viewManagerName}' has a ViewManager and you want to retrieve its native ViewConfig, please turn on the native ViewConfig interop layer. If you want to see if this component is registered with React Native, please call hasViewManagerConfig('${viewManagerName}') instead.`, ); return null; }