Don't lazy-load components in ErrorBoundary
We currently handle major errors through ErrorBoundary. If the error is network related, ErrorBoundary ends up blank if it's components are lazy-loaded. #codesplit
This commit is contained in:
parent
3fad222848
commit
3017155867
1 changed files with 24 additions and 27 deletions
|
@ -1,15 +1,14 @@
|
|||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import React from 'react';
|
||||
import Yrbl from 'component/yrbl';
|
||||
import Button from 'component/button';
|
||||
import { withRouter } from 'react-router';
|
||||
import analytics from 'analytics';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import Native from 'native';
|
||||
import { Lbry } from 'lbry-redux';
|
||||
|
||||
const Button = React.lazy(() => import('component/button' /* webpackChunkName: "button" */));
|
||||
const I18nMessage = React.lazy(() => import('component/i18nMessage' /* webpackChunkName: "i18nMessage" */));
|
||||
const Yrbl = React.lazy(() => import('component/yrbl' /* webpackChunkName: "yrbl" */));
|
||||
|
||||
type Props = {
|
||||
children: Node,
|
||||
history: {
|
||||
|
@ -75,7 +74,6 @@ class ErrorBoundary extends React.Component<Props, State> {
|
|||
if (hasError) {
|
||||
return (
|
||||
<div className="main main--full-width main--empty">
|
||||
<React.Suspense fallback={null}>
|
||||
<Yrbl
|
||||
type="sad"
|
||||
title={__('Aw shucks!')}
|
||||
|
@ -97,7 +95,6 @@ class ErrorBoundary extends React.Component<Props, State> {
|
|||
</I18nMessage>
|
||||
}
|
||||
/>
|
||||
</React.Suspense>
|
||||
{!errorWasReported && (
|
||||
<div className="error__wrapper">
|
||||
<span className="error__text">
|
||||
|
|
Loading…
Reference in a new issue