Sfoglia il codice sorgente

Defaults to WKWebView instead of UIWebView

Jamon Holmgren 6 anni fa
parent
commit
236e613421
2 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 2
    2
      README.md
  2. 1
    0
      js/WebView.ios.js

+ 2
- 2
README.md Vedi File

@@ -33,7 +33,6 @@ class MyWebComponent extends Component {
33 33
   render () {
34 34
     return (
35 35
       <WebView
36
-        useWebKit // to use WKWebView -- will be default at some point
37 36
         src={{uri: "https://infinite.red/react-native"}}
38 37
         style={{marginTop: 20}}
39 38
       />
@@ -48,11 +47,12 @@ Additional properties are supported and will be added here; for now, refer to th
48 47
 
49 48
 ## Migrate from React Native core WebView to React Native WebView
50 49
 
51
-Simply install React Native WebView and then use it in place of the core WebView. Their APIs are currently identical.
50
+Simply install React Native WebView and then use it in place of the core WebView. Their APIs are currently identical, except that this package defaults `useWebKit={true}` unlike the built-in WebView.
52 51
 
53 52
 ### Contributor Notes
54 53
 
55 54
 * I've removed all PropTypes for now. Instead, we'll be moving toward Flow or TypeScript at a later date
55
+* UIWebView is not tested fully and you will encounter some yellow warning boxes. Since it is deprecated, we don't intend to put a lot of time into supporting it, but feel free to submit PRs if you have a special use case. Note that you will need to specify `useWebKit={false}` to use UIWebView
56 56
 
57 57
 ## Maintainers
58 58
 

+ 1
- 0
js/WebView.ios.js Vedi File

@@ -126,6 +126,7 @@ class WebView extends React.Component {
126 126
   static NavigationType = NavigationType;
127 127
 
128 128
   static defaultProps = {
129
+    useWebKit: true,
129 130
     originWhitelist: WebViewShared.defaultOriginWhitelist,
130 131
   };
131 132