Просмотр исходного кода

docs(Documentation): Expo and Troubleshooting (#145)

* Add fix for keyboard dismiss leaving viewport shifted in iOS 12

* Readme - added note about Expo and added troubleshooting section
Jamon Holmgren 6 лет назад
Родитель
Сommit
8064f66e03
1 измененных файлов: 11 добавлений и 5 удалений
  1. 11
    5
      README.md

+ 11
- 5
README.md Просмотреть файл

@@ -8,6 +8,8 @@
8 8
 - [x] Android
9 9
 - [ ] Windows 10 (coming soon)
10 10
 
11
+_Note: React Native WebView is not currently supported by Expo unless you "eject"._
12
+
11 13
 ## Versioning
12 14
 
13 15
 If you need the exact same WebView as the one from react-native, please use version **2.0.0**. Future versions will follow [semantic versioning](https://semver.org/).
@@ -26,18 +28,18 @@ Read our [Getting Started Guide](./docs/Getting-Started.md) for more.
26 28
 Import the `WebView` component from `react-native-webview` and use it like so:
27 29
 
28 30
 ```jsx
29
-import React, { Component } from 'react';
30
-import { StyleSheet, Text, View } from 'react-native';
31
-import { WebView } from 'react-native-webview';
31
+import React, { Component } from "react";
32
+import { StyleSheet, Text, View } from "react-native";
33
+import { WebView } from "react-native-webview";
32 34
 
33 35
 // ...
34 36
 class MyWebComponent extends Component {
35 37
   render() {
36 38
     return (
37 39
       <WebView
38
-        source={{ uri: 'https://infinite.red/react-native' }}
40
+        source={{ uri: "https://infinite.red/react-native" }}
39 41
         style={{ marginTop: 20 }}
40
-        onLoadProgress={e=>console.log(e.nativeEvent.progress)}
42
+        onLoadProgress={e => console.log(e.nativeEvent.progress)}
41 43
       />
42 44
     );
43 45
   }
@@ -50,6 +52,10 @@ For more, read the [API Reference](./docs/Reference.md) and [Guide](./docs/Guide
50 52
 
51 53
 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 54
 
55
+## Troubleshooting
56
+
57
+- If you're getting `Invariant Violation: Native component for "RNCWKWebView does not exist"` it likely means you forgot to run `react-native link` or there was some error with the linking process
58
+
53 59
 ### Contributor Notes
54 60
 
55 61
 - I've removed all PropTypes for now. Instead, we'll be using Flow types. TypeScript types will be added at a later date.