Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

Commit da013cd

Browse files
authored
Merge pull request #1 from lava-x/upgrade-react-native-webview
use back react-native-webview
2 parents 4d6f967 + df9a0f0 commit da013cd

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import React from "react";
44

55
import PropTypes from "prop-types";
6-
7-
import { WebView, View, Linking, PixelRatio } from "react-native";
6+
import { WebView } from "react-native-webview";
7+
import { View, Linking, PixelRatio } from "react-native";
88

99
import BaseComponent from "./BaseComponent";
1010
import Utils from "./Utils";
@@ -62,7 +62,6 @@ class Webbrowser extends BaseComponent {
6262
forwardButtonEnabled: false,
6363
homeButtonEnabled: true,
6464
loading: true,
65-
scalesPageToFit: true,
6665
jsCode: this.props.jsCode,
6766
cookie: this.props.cookie,
6867
WebViewHeight: 0
@@ -177,7 +176,6 @@ class Webbrowser extends BaseComponent {
177176
</View>
178177
<WebView
179178
ref={WEBVIEW_REF}
180-
useWebKit={true}
181179
scrollEnabled={this.props.toBlockPage ? false : true}
182180
automaticallyAdjustContentInsets={false}
183181
style={styles.webView}
@@ -189,8 +187,6 @@ class Webbrowser extends BaseComponent {
189187
onNavigationStateChange={this.onNavigationStateChange}
190188
onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
191189
startInLoadingState={true}
192-
// scalesPageToFit is not usable when useWebKit is set to true
193-
scalesPageToFit={this.state.scalesPageToFit}
194190
onLoad={() => this.refs[WEBVIEW_REF].postMessage(this.state.cookie)}
195191
{...(this.state.jsCode
196192
? { injectedJavaScript: this.state.jsCode }
@@ -259,7 +255,6 @@ class Webbrowser extends BaseComponent {
259255
currentUrl: navState.url,
260256
status: navState.title,
261257
loading: navState.loading,
262-
scalesPageToFit: true
263258
});
264259

265260
this.props.onNavigationStateChange(navState);

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"url": "git+https://github.com/lavajeff/react-native-webview-browser.git"
88
},
99
"author": "Jeffrey Chai <jeffrey@lavax.co>",
10-
"license": "MIT"
10+
"license": "MIT",
11+
"dependencies": {
12+
"react-native-webview": "^7.5.1"
13+
}
1114
}

yarn.lock

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,34 @@
22
# yarn lockfile v1
33

44

5+
escape-string-regexp@2.0.0:
6+
version "2.0.0"
7+
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
8+
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
9+
10+
invariant@2.2.4:
11+
version "2.2.4"
12+
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
13+
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
14+
dependencies:
15+
loose-envify "^1.0.0"
16+
17+
"js-tokens@^3.0.0 || ^4.0.0":
18+
version "4.0.0"
19+
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
20+
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
21+
22+
loose-envify@^1.0.0:
23+
version "1.4.0"
24+
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
25+
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
26+
dependencies:
27+
js-tokens "^3.0.0 || ^4.0.0"
28+
29+
react-native-webview@^7.5.1:
30+
version "7.5.1"
31+
resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-7.5.1.tgz#01b026c1110d7548123460cc640fb1d4227a0f54"
32+
integrity sha512-lFpa4m8CMapk6vbZf2GiQDGxsQSRrKoVElTFCkDI5BEl5/a14ClASnJdIyr6U6uYj7ZjcAYsaqNtz86BJqyRVQ==
33+
dependencies:
34+
escape-string-regexp "2.0.0"
35+
invariant "2.2.4"

0 commit comments

Comments
 (0)