diff options
Diffstat (limited to 'src/components/util/ErrorBoundary/index.tsx')
-rw-r--r-- | src/components/util/ErrorBoundary/index.tsx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/components/util/ErrorBoundary/index.tsx b/src/components/util/ErrorBoundary/index.tsx index bef211ef9..66f860835 100644 --- a/src/components/util/ErrorBoundary/index.tsx +++ b/src/components/util/ErrorBoundary/index.tsx | |||
@@ -23,10 +23,18 @@ interface ErrorBoundaryProps extends WithStylesProps<typeof styles> { | |||
23 | children?: React.ReactNode; | 23 | children?: React.ReactNode; |
24 | } | 24 | } |
25 | 25 | ||
26 | class ErrorBoundary extends Component<ErrorBoundaryProps> { | 26 | interface ErrorBoundaryState { |
27 | state = { | 27 | hasError: boolean; |
28 | hasError: false, | 28 | } |
29 | }; | 29 | |
30 | class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> { | ||
31 | constructor(props) { | ||
32 | super(props); | ||
33 | |||
34 | this.state = { | ||
35 | hasError: false, | ||
36 | }; | ||
37 | } | ||
30 | 38 | ||
31 | componentDidCatch(): void { | 39 | componentDidCatch(): void { |
32 | this.setState({ hasError: true }); | 40 | this.setState({ hasError: true }); |