Skip to content

Commit

Permalink
Return an empty object for RCTVirtualText from DummyUIManager
Browse files Browse the repository at this point in the history
Summary:
We currently use `UIManager.getViewManagerConfig()` in a few places to check if a view manager exists at runtime; right now these checks fail for Venice because our DummyUIManager returns null. We don't yet have a replacement for this API for Fabric (see T59411524) so for now let's just hard code the view managers that we know exist to return something truthy here. This is hacky, but it works ok for now.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D19185957

fbshipit-source-id: e3135b45db4c9ff27fd95362deaa3c1b4340bf48
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed Dec 21, 2019
1 parent e2ec34d commit 282b8b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/ReactNative/DummyUIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
'use strict';

module.exports = {
getViewManagerConfig: (viewManagerName: string): null => {
getViewManagerConfig: (viewManagerName: string): mixed => {
console.warn(
'Attempting to get config for view manager: ' + viewManagerName,
);
if (viewManagerName === 'RCTVirtualText') {
return {};
}
return null;
},
getConstants: (): {...} => ({}),
Expand Down

0 comments on commit 282b8b0

Please sign in to comment.