소스 검색

call onHeightUpdated when height is valid

iou90 9 년 전
부모
커밋
58d756f9ae
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 5
    3
      autoHeightWebView/index.ios.js
  2. 1
    1
      package.json

+ 5
- 3
autoHeightWebView/index.ios.js 파일 보기

48
 
48
 
49
     handleNavigationStateChange(navState) {
49
     handleNavigationStateChange(navState) {
50
         const height = Number(navState.title);
50
         const height = Number(navState.title);
51
-        this.setState({ height });
52
-        if (this.props.onHeightUpdated) {
53
-            this.props.onHeightUpdated(height);
51
+        if (height) {
52
+            this.setState({ height });
53
+            if (this.props.onHeightUpdated) {
54
+                this.props.onHeightUpdated(height);
55
+            }
54
         }
56
         }
55
     }
57
     }
56
 
58
 

+ 1
- 1
package.json 파일 보기

1
 {
1
 {
2
   "name": "react-native-autoheightwebview",
2
   "name": "react-native-autoheightwebview",
3
-  "version": "0.0.5",
3
+  "version": "0.0.6",
4
   "description": "An auto height webview for React Native",
4
   "description": "An auto height webview for React Native",
5
   "main": "autoHeightWebView",
5
   "main": "autoHeightWebView",
6
   "scripts": {
6
   "scripts": {