Browse Source

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 years ago
parent
commit
8064f66e03
1 changed files with 11 additions and 5 deletions
  1. 11
    5
      README.md

+ 11
- 5
README.md View File

8
 - [x] Android
8
 - [x] Android
9
 - [ ] Windows 10 (coming soon)
9
 - [ ] Windows 10 (coming soon)
10
 
10
 
11
+_Note: React Native WebView is not currently supported by Expo unless you "eject"._
12
+
11
 ## Versioning
13
 ## Versioning
12
 
14
 
13
 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/).
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
 Import the `WebView` component from `react-native-webview` and use it like so:
28
 Import the `WebView` component from `react-native-webview` and use it like so:
27
 
29
 
28
 ```jsx
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
 class MyWebComponent extends Component {
36
 class MyWebComponent extends Component {
35
   render() {
37
   render() {
36
     return (
38
     return (
37
       <WebView
39
       <WebView
38
-        source={{ uri: 'https://infinite.red/react-native' }}
40
+        source={{ uri: "https://infinite.red/react-native" }}
39
         style={{ marginTop: 20 }}
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
 
52
 
51
 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.
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
 ### Contributor Notes
59
 ### Contributor Notes
54
 
60
 
55
 - I've removed all PropTypes for now. Instead, we'll be using Flow types. TypeScript types will be added at a later date.
61
 - I've removed all PropTypes for now. Instead, we'll be using Flow types. TypeScript types will be added at a later date.