GermaVinsmoke 72452dc946
chore: remove react import (#2727)
* chore: added jsx-runtime plugin in eslint tsconfig

Signed-off-by: GermaVinsmoke <vaibhav1180@gmail.com>

* chore: updated react imports

Signed-off-by: GermaVinsmoke <vaibhav1180@gmail.com>

* chore: renamed redux dispatch

Signed-off-by: GermaVinsmoke <vaibhav1180@gmail.com>

* fix: build is fixed

---------

Signed-off-by: GermaVinsmoke <vaibhav1180@gmail.com>
Co-authored-by: Palash Gupta <palashgdev@gmail.com>
2023-05-19 13:14:32 +05:30

34 lines
531 B
TypeScript

import { PureComponent } from 'react';
interface State {
hasError: boolean;
}
interface Props {
children: JSX.Element;
}
class ErrorLink extends PureComponent<Props, State> {
constructor(props: Props) {
super(props);
this.state = { hasError: false };
}
static getDerivedStateFromError(): State {
return { hasError: true };
}
render(): JSX.Element {
const { children } = this.props;
const { hasError } = this.state;
if (hasError) {
return <div />;
}
return children;
}
}
export default ErrorLink;