Explorar el Código

fix Converting circular structure to JSON issue on some android devices

iou90 hace 5 años
padre
commit
8505010fce
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1
    1
      autoHeightWebView/index.js
  2. 1
    1
      autoHeightWebView/utils.js

+ 1
- 1
autoHeightWebView/index.js Ver fichero

27
     width: getWidth(style)
27
     width: getWidth(style)
28
   }));
28
   }));
29
   const hanldeMessage = event => {
29
   const hanldeMessage = event => {
30
+    onMessage && onMessage(event);
30
     if (!event.nativeEvent) {
31
     if (!event.nativeEvent) {
31
       return;
32
       return;
32
     }
33
     }
45
         height,
46
         height,
46
         width
47
         width
47
       });
48
       });
48
-    onMessage && onMessage(event);
49
   };
49
   };
50
 
50
 
51
   const { currentSource, script } = useMemo(
51
   const { currentSource, script } = useMemo(

+ 1
- 1
autoHeightWebView/utils.js Ver fichero

23
     clearInterval(updateSizeInterval)
23
     clearInterval(updateSizeInterval)
24
     height = ${element}.offsetHeight || window.innerHeight;
24
     height = ${element}.offsetHeight || window.innerHeight;
25
     width = ${element}.offsetWidth || window.innerWidth;
25
     width = ${element}.offsetWidth || window.innerWidth;
26
-    window.ReactNativeWebView.postMessage(JSON.stringify({ width: width, height: height, event: event }));
26
+    window.ReactNativeWebView.postMessage(JSON.stringify({ width: width, height: height }));
27
   }
27
   }
28
   `;
28
   `;
29
 
29