The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/ErrorBoundary.tsx

17 lines
353 B

import { Component, ReactNode } from 'react';
export class ErrorBoundary extends Component<{}, { hasError: boolean }> {
state = { hasError: false };
static getDerivedStateFromError(): { hasError: boolean } {
return { hasError: true };
}
render(): ReactNode {
if (this.state.hasError) {
return null;
}
return this.props.children;
}
}