Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Libraries/Components/WebView/WebView.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ class WebView extends React.Component {
* @platform android
*/
allowUniversalAccessFromFileURLs: PropTypes.bool,

/**
* Override the native component used to render the WebView. Enables a custom native

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no-trailing-spaces: Trailing spaces not allowed.

* WebView which uses the same JavaScript as the original WebView.
*/
nativeComponent: PropTypes.any,

/**
* Set props directly on the native component WebView. Enables custom props which the
* original WebView doesn't pass through.
*/
nativeComponentProps: PropTypes.object
};

static defaultProps = {
Expand Down Expand Up @@ -214,8 +226,11 @@ class WebView extends React.Component {
console.warn('WebView: `source.body` is not supported when using GET.');
}

let NativeWebView = this.props.nativeComponent || RCTWebView;

var webView =
<RCTWebView
<NativeWebView
{...this.props.nativeComponentProps}
ref={RCT_WEBVIEW_REF}
key="webViewKey"
style={webViewStyles}
Expand Down
17 changes: 16 additions & 1 deletion Libraries/Components/WebView/WebView.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,18 @@ class WebView extends React.Component {
* to tap them before they start playing. The default value is `true`.
*/
mediaPlaybackRequiresUserAction: PropTypes.bool,

/**
* Override the native component used to render the WebView. Enables a custom native

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no-trailing-spaces: Trailing spaces not allowed.

* WebView which uses the same JavaScript as the original WebView.
*/
nativeComponent: PropTypes.any,

/**
* Set props directly on the native component WebView. Enables custom props which the
* original WebView doesn't pass through.
*/
nativeComponentProps: PropTypes.object
};

state = {
Expand Down Expand Up @@ -394,8 +406,11 @@ class WebView extends React.Component {

const messagingEnabled = typeof this.props.onMessage === 'function';

let NativeWebView = this.props.nativeComponent || RCTWebView;

var webView =
<RCTWebView
<NativeWebView
{...this.props.nativeComponentProps}
ref={RCT_WEBVIEW_REF}
key="webViewKey"
style={webViewStyles}
Expand Down