last test
This commit is contained in:
parent
bee15de552
commit
96334d31ed
|
@ -254,19 +254,15 @@ 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(
|
console.warn(
|
||||||
'WebView: `source.headers` is not supported when using POST.',
|
'WebView: `source.headers` is not supported when using POST.',
|
||||||
);
|
);
|
||||||
} else if (
|
} else if (source.method === 'GET' && source.body) {
|
||||||
(source as WebViewUriSource).method === 'GET'
|
|
||||||
&& (source as WebViewUriSource).body
|
|
||||||
) {
|
|
||||||
console.warn('WebView: `source.body` is not supported when using GET.');
|
console.warn('WebView: `source.body` is not supported when using GET.');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const NativeWebView
|
const NativeWebView
|
||||||
= (nativeConfig.component as typeof NativeWebViewAndroid) || RNCWebView;
|
= (nativeConfig.component as typeof NativeWebViewAndroid) || RNCWebView;
|
||||||
|
@ -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}
|
||||||
|
|
|
@ -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}
|
||||||
|
|
|
@ -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>;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue