Browse Source

fix onSizeUpdated issue for demo

iou90 5 years ago
parent
commit
df60571de2
2 changed files with 9 additions and 2 deletions
  1. 7
    0
      demo/.eslintrc.js
  2. 2
    2
      demo/App.js

+ 7
- 0
demo/.eslintrc.js View File

1
 module.exports = {
1
 module.exports = {
2
   root: true,
2
   root: true,
3
   extends: '@react-native-community',
3
   extends: '@react-native-community',
4
+  rules: {
5
+    'prettier/prettier': [
6
+      {
7
+        singleQuote: true
8
+      }
9
+    ]
10
+  }
4
 };
11
 };

+ 2
- 2
demo/App.js View File

72
           console.log(result);
72
           console.log(result);
73
           return true;
73
           return true;
74
         }}
74
         }}
75
-        onSizeUpdated={heightSize => setHeightSize(heightSize)}
75
+        onSizeUpdated={setHeightSize}
76
         source={{ html: heightHtml }}
76
         source={{ html: heightHtml }}
77
         customScript={heightScript}
77
         customScript={heightScript}
78
         onMessage={event => {
78
         onMessage={event => {
118
           console.log(result);
118
           console.log(result);
119
           return true;
119
           return true;
120
         }}
120
         }}
121
-        onSizeUpdated={widthSize => setWidthSize(widthSize)}
121
+        onSizeUpdated={setWidthSize}
122
         source={{ html: widthHtml }}
122
         source={{ html: widthHtml }}
123
         customScript={widthScript}
123
         customScript={widthScript}
124
       />
124
       />