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
This commit is contained in:
Ramanpreet Nara
2024-01-10 07:01:22 -08:00
committed by Facebook GitHub Bot
parent d825e7a5d4
commit 9670bde5ab
@@ -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;
}