mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-12 04:01:29 +08:00

* 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>
34 lines
531 B
TypeScript
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;
|