|
@@ -12,10 +12,20 @@ $ yarn add react-native-webview
|
12
|
12
|
|
13
|
13
|
React Native modules that include native Objective-C, Swift, Java, or Kotlin code have to be "linked" so that the compiler knows to include them in the app.
|
14
|
14
|
|
15
|
|
-This module does not require any extra step after running the link command 🎉
|
16
|
15
|
```
|
17
|
16
|
$ react-native link react-native-webview
|
18
|
17
|
```
|
|
18
|
+
|
|
19
|
+iOS:
|
|
20
|
+This module does not require any extra step after running the link command 🎉
|
|
21
|
+Android:
|
|
22
|
+Please make sure AndroidX is enabled in your project by editting `android/gradle.properties` and adding 2 lines:
|
|
23
|
+
|
|
24
|
+```
|
|
25
|
+android.useAndroidX=true
|
|
26
|
+android.enableJetifier=true
|
|
27
|
+```
|
|
28
|
+
|
19
|
29
|
For Android manual installation, please refer to [this article](https://engineering.brigad.co/demystifying-react-native-modules-linking-964399ec731b) where you can find detailed step on how to link any react-native project.
|
20
|
30
|
|
21
|
31
|
For iOS, while you can manually link the old way using [react-native own tutorial](https://facebook.github.io/react-native/docs/linking-libraries-ios), we find it easier to use cocoapods.
|
|
@@ -33,8 +43,8 @@ class MyWeb extends Component {
|
33
|
43
|
render() {
|
34
|
44
|
return (
|
35
|
45
|
<WebView
|
36
|
|
- source={{uri: 'https://infinite.red'}}
|
37
|
|
- style={{marginTop: 20}}
|
|
46
|
+ source={{ uri: 'https://infinite.red' }}
|
|
47
|
+ style={{ marginTop: 20 }}
|
38
|
48
|
/>
|
39
|
49
|
);
|
40
|
50
|
}
|