소스 검색

fix(android): renderError - the error status might be overwritte… (#915)

Roc 4 년 전
부모
커밋
01de9e5fa0
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5
    2
      src/WebView.android.tsx

+ 5
- 2
src/WebView.android.tsx 파일 보기

@@ -218,8 +218,11 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
218 218
     const { onLoadProgress } = this.props;
219 219
     const { nativeEvent: { progress } } = event;
220 220
     if (progress === 1) {
221
-      this.setState({
222
-        viewState: 'IDLE',
221
+      this.setState((state) => {
222
+        if (state.viewState === 'LOADING') {
223
+          return { viewState: 'IDLE' };
224
+        }
225
+        return null;
223 226
       });
224 227
     }
225 228
     if (onLoadProgress) {