Merge pull request #29174 from tn0502/tn0502/rn-usewebkit

react-native: Added useWebKit property to WebViewProps.
This commit is contained in:
Eloy Durán
2018-09-25 11:03:06 +02:00
committed by GitHub
2 changed files with 9 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for react-native 0.56
// Type definitions for react-native 0.57
// Project: https://github.com/facebook/react-native
// Definitions by: Eloy Durán <https://github.com/alloy>
// HuHuanming <https://github.com/huhuanming>
@@ -2244,6 +2244,11 @@ export interface WebViewPropsIOS {
* `WebView`. The default value is `true`.
*/
scrollEnabled?: boolean;
/**
* If `true`, use WKWebView instead of UIWebView.
*/
useWebKit?: boolean;
}
export interface WebViewUriSource {

View File

@@ -663,10 +663,11 @@ class WebViewTest extends React.Component {
render() {
return (
<WebView
originWhitelist={['https://origin.test']}
saveFormDataDisabled={false}
nativeConfig={{ component: 'test', props: {}, viewManager: {} }}
onShouldStartLoadWithRequest={(event) => event.navigationType !== 'formresubmit'}
originWhitelist={['https://origin.test']}
saveFormDataDisabled={false}
useWebKit={true}
/>
);
}