fix: improved typing (#174)

This commit is contained in:
Thomas Klein
2019-10-10 22:20:05 +02:00
committed by Juan Picado @jotadeveloper
parent 68b7171de4
commit e0642a9d0d
16 changed files with 37 additions and 30 deletions

View File

@@ -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 });
}