Przeglądaj źródła

fix files issue

iou90 7 lat temu
rodzic
commit
49e654775c

+ 1
- 1
autoHeightWebView/index.android.js Wyświetl plik

@@ -58,7 +58,7 @@ export default class AutoHeightWebView extends Component {
58 58
             });
59 59
         }
60 60
         let currentScript = BaseScript;
61
-        if ((nextProps.files && !this.props.files) || (nextProps.files && this.props.files && JSON.stringify(nextProps.files) !== JSON.stringify(this.props.files))) {
61
+        if (nextProps.files) {
62 62
             currentScript = this.appendFilesToHead(nextProps.files, BaseScript);
63 63
         }
64 64
         this.setState({ script: currentScript });

+ 1
- 1
autoHeightWebView/index.ios.js Wyświetl plik

@@ -24,7 +24,7 @@ export default class AutoHeightWebView extends Component {
24 24
 
25 25
     componentWillReceiveProps(nextProps) {
26 26
         let currentScript = BaseScript;
27
-        if ((nextProps.files && !this.props.files) || (nextProps.files && this.props.files && JSON.stringify(nextProps.files) !== JSON.stringify(this.props.files))) {
27
+        if (nextProps.files) {
28 28
             currentScript = this.appendFilesToHead(nextProps.files, BaseScript);
29 29
         }
30 30
         this.setState({ script: currentScript });

+ 6
- 3
package.json Wyświetl plik

@@ -1,9 +1,12 @@
1 1
 {
2 2
   "name": "react-native-autoheightwebview",
3
-  "version": "0.0.16",
3
+  "version": "0.0.17",
4 4
   "description": "An auto height webview for React Native",
5 5
   "main": "autoHeightWebView",
6
-  "files": ["android/", "autoHeightWebView/"],
6
+  "files": [
7
+    "android/",
8
+    "autoHeightWebView/"
9
+  ],
7 10
   "scripts": {
8 11
     "test": "echo \"Error: no test specified\" && exit 1"
9 12
   },
@@ -17,4 +20,4 @@
17 20
     "url": "https://github.com/iou90/react-native-autoheightwebview/issues"
18 21
   },
19 22
   "homepage": "https://github.com/iou90/react-native-autoheightwebview#readme"
20
-}
23
+}