Refactor UIManager view manager accesses

Summary: Replaced each view manager access with a getViewManager() function call. This will later be used to lazily load view manager classes by allowing java to avoid sending the entire list of view managers to JS.

Reviewed By: QueryConnectionException

Differential Revision: D9695788

fbshipit-source-id: 949858aa2f0b0b00b68e260461ba8f1d085cf07f
This commit is contained in:
Andrew Chen (Eng)
2018-09-27 15:55:31 -07:00
committed by Facebook Github Bot
parent 471e8c168a
commit aac7c4d5d2
17 changed files with 51 additions and 37 deletions

View File

@@ -366,7 +366,7 @@ class WebView extends React.Component {
goForward = () => {
UIManager.dispatchViewManagerCommand(
this.getWebViewHandle(),
UIManager.RCTWebView.Commands.goForward,
UIManager.getViewManagerConfig('RCTWebView').Commands.goForward,
null,
);
};
@@ -374,7 +374,7 @@ class WebView extends React.Component {
goBack = () => {
UIManager.dispatchViewManagerCommand(
this.getWebViewHandle(),
UIManager.RCTWebView.Commands.goBack,
UIManager.getViewManagerConfig('RCTWebView').Commands.goBack,
null,
);
};
@@ -385,7 +385,7 @@ class WebView extends React.Component {
});
UIManager.dispatchViewManagerCommand(
this.getWebViewHandle(),
UIManager.RCTWebView.Commands.reload,
UIManager.getViewManagerConfig('RCTWebView').Commands.reload,
null,
);
};
@@ -393,7 +393,7 @@ class WebView extends React.Component {
stopLoading = () => {
UIManager.dispatchViewManagerCommand(
this.getWebViewHandle(),
UIManager.RCTWebView.Commands.stopLoading,
UIManager.getViewManagerConfig('RCTWebView').Commands.stopLoading,
null,
);
};
@@ -401,7 +401,7 @@ class WebView extends React.Component {
postMessage = data => {
UIManager.dispatchViewManagerCommand(
this.getWebViewHandle(),
UIManager.RCTWebView.Commands.postMessage,
UIManager.getViewManagerConfig('RCTWebView').Commands.postMessage,
[String(data)],
);
};
@@ -415,7 +415,7 @@ class WebView extends React.Component {
injectJavaScript = data => {
UIManager.dispatchViewManagerCommand(
this.getWebViewHandle(),
UIManager.RCTWebView.Commands.injectJavaScript,
UIManager.getViewManagerConfig('RCTWebView').Commands.injectJavaScript,
[data],
);
};