瀏覽代碼

fix(android): crash problem while loading local html resource (#1010)

小米-余乐 4 年之前
父節點
當前提交
05c286fc23
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      src/WebView.android.tsx

+ 1
- 1
src/WebView.android.tsx 查看文件

@@ -278,7 +278,7 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
278 278
     const webViewStyles = [styles.container, styles.webView, style];
279 279
     const webViewContainerStyle = [styles.container, containerStyle];
280 280
 
281
-    if (source && 'method' in source) {
281
+    if (typeof source !== "number" && source && 'method' in source) {
282 282
       if (source.method === 'POST' && source.headers) {
283 283
         console.warn(
284 284
           'WebView: `source.headers` is not supported when using POST.',