last test

This commit is contained in:
Thibault Malbranche 2019-03-20 12:25:36 +00:00
parent bee15de552
commit 96334d31ed
3 changed files with 10 additions and 18 deletions

View File

@ -254,18 +254,14 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
webViewStyles.push(styles.hidden); webViewStyles.push(styles.hidden);
} }
if ( if (source && 'method' in source) {
(source as WebViewUriSource).method === 'POST' if (source.method === 'POST' && source.headers) {
&& (source as WebViewUriSource).headers console.warn(
) { 'WebView: `source.headers` is not supported when using POST.',
console.warn( );
'WebView: `source.headers` is not supported when using POST.', } else if (source.method === 'GET' && source.body) {
); console.warn('WebView: `source.body` is not supported when using GET.');
} else if ( }
(source as WebViewUriSource).method === 'GET'
&& (source as WebViewUriSource).body
) {
console.warn('WebView: `source.body` is not supported when using GET.');
} }
const NativeWebView const NativeWebView
@ -280,8 +276,8 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
const webView = ( const webView = (
<NativeWebView <NativeWebView
{...otherProps}
key="webViewKey" key="webViewKey"
{...otherProps}
messagingEnabled={typeof onMessage === 'function'} messagingEnabled={typeof onMessage === 'function'}
onLoadingError={this.onLoadingError} onLoadingError={this.onLoadingError}
onLoadingFinish={this.onLoadingFinish} onLoadingFinish={this.onLoadingFinish}

View File

@ -391,9 +391,9 @@ class WebView extends React.Component<IOSWebViewProps, State> {
const webView = ( const webView = (
<NativeWebView <NativeWebView
key="webViewKey"
{...otherProps} {...otherProps}
decelerationRate={decelerationRate} decelerationRate={decelerationRate}
key="webViewKey"
messagingEnabled={typeof onMessage === 'function'} messagingEnabled={typeof onMessage === 'function'}
onLoadingError={this.onLoadingError} onLoadingError={this.onLoadingError}
onLoadingFinish={this.onLoadingFinish} onLoadingFinish={this.onLoadingFinish}

View File

@ -3,9 +3,7 @@
import { ReactElement, Component } from 'react'; import { ReactElement, Component } from 'react';
import { import {
NativeSyntheticEvent, NativeSyntheticEvent,
ViewStyle,
ViewProps, ViewProps,
StyleProp,
NativeMethodsMixin, NativeMethodsMixin,
Constructor, Constructor,
UIManagerStatic, UIManagerStatic,
@ -619,6 +617,4 @@ export interface WebViewSharedProps extends ViewProps {
* Should caching be enabled. Default is true. * Should caching be enabled. Default is true.
*/ */
cacheEnabled?: boolean; cacheEnabled?: boolean;
style?: StyleProp<ViewStyle>;
} }