Don't throw when accessing view config

Summary:
It turns out that it's expected in certain cases for `UIManager.getViewManagerConfig` to return null: https://fburl.com/4h4pqtd7

Instead of throwing when you try to call that function, let's log something and return null.

Reviewed By: fkgozali

Differential Revision: D15791367

fbshipit-source-id: 71cf14071d877070b4f8b2d72eaa2f10beac38db
This commit is contained in:
Emily Janzer
2019-06-12 16:18:36 -07:00
committed by Facebook Github Bot
parent 533932ada9
commit 3f951378bf
+3 -2
View File
@@ -11,9 +11,10 @@
module.exports = {
getViewManagerConfig: (viewManagerName: string) => {
throw new Error(
'Attempting to get config for view manager ' + viewManagerName,
console.warn(
'Attempting to get config for view manager: ' + viewManagerName,
);
return null;
},
getConstants: () => ({}),
getConstantsForViewManager: (viewManagerName: string) => {},