File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 44 * SPDX-License-Identifier: MIT
55 */
66import { Text } from "@chakra-ui/layout" ;
7- import React , { ErrorInfo } from "react" ;
7+ import React , { ErrorInfo , ReactNode } from "react" ;
88import { FormattedMessage } from "react-intl" ;
99import { LoggingContext } from "../logging/logging-hooks" ;
1010
11- interface State {
11+ interface ErrorBoundaryState {
1212 hasError : boolean ;
1313}
1414
15- class ErrorBoundary extends React . Component < { } , State > {
15+ interface ErrorBoundaryProps {
16+ children : ReactNode ;
17+ }
18+
19+ class ErrorBoundary extends React . Component <
20+ ErrorBoundaryProps ,
21+ ErrorBoundaryState
22+ > {
1623 context ! : React . ContextType < typeof LoggingContext > ;
1724
18- constructor ( props : { } ) {
25+ constructor ( props : ErrorBoundaryProps ) {
1926 super ( props ) ;
2027 this . state = { hasError : false } ;
2128 }
@@ -36,7 +43,7 @@ class ErrorBoundary extends React.Component<{}, State> {
3643 </ Text >
3744 ) ;
3845 }
39- return this . props . children ;
46+ return < > { this . props . children } </ > ;
4047 }
4148}
4249
You can’t perform that action at this time.
0 commit comments