From 13b4c2d77b855a1e20b153700bdfa5106bfcc346 Mon Sep 17 00:00:00 2001 From: Luke Miles Date: Thu, 2 Mar 2017 15:24:27 -0800 Subject: [PATCH] : Add propType for injectJavaScript Summary: Small fix. Adds a proptype for the injectJavaScript function, added in da9a712a9e17942dcd05b8d955f0764c2026a4ad. Closes https://github.com/facebook/react-native/pull/12665 Differential Revision: D4645803 Pulled By: hramos fbshipit-source-id: 863e5bf82b853914ac08f9f5b2c141d35882afc7 --- Libraries/Components/WebView/WebView.android.js | 6 ++++++ Libraries/Components/WebView/WebView.ios.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index 294095035..170f14240 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -160,6 +160,12 @@ class WebView extends React.Component { * @platform android */ allowUniversalAccessFromFileURLs: PropTypes.bool, + + /** + * Function that accepts a string that will be passed to the WebView and + * executed immediately as JavaScript. + */ + injectJavaScript: PropTypes.func, }; static defaultProps = { diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index 15409e2cc..a6bcc5949 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -334,6 +334,12 @@ class WebView extends React.Component { * to tap them before they start playing. The default value is `true`. */ mediaPlaybackRequiresUserAction: PropTypes.bool, + + /** + * Function that accepts a string that will be passed to the WebView and + * executed immediately as JavaScript. + */ + injectJavaScript: PropTypes.func, }; state = {