forked from sombochea/verdaccio-ui
fix: improved typing (#174)
This commit is contained in:
committed by
Juan Picado @jotadeveloper
parent
68b7171de4
commit
e0642a9d0d
@@ -6,17 +6,17 @@ export interface ErrorProps {
|
||||
|
||||
export interface ErrorAppState {
|
||||
hasError: boolean;
|
||||
error: any;
|
||||
info: any;
|
||||
error: Error | null;
|
||||
info: object | null;
|
||||
}
|
||||
|
||||
export default class ErrorBoundary extends Component<ErrorProps, ErrorAppState> {
|
||||
constructor(props) {
|
||||
constructor(props: ErrorProps) {
|
||||
super(props);
|
||||
this.state = { hasError: false, error: null, info: null };
|
||||
}
|
||||
|
||||
public componentDidCatch(error, info) {
|
||||
public componentDidCatch(error: Error, info: object) {
|
||||
this.setState({ hasError: true, error, info });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user