Commit 12a3edd6 by Johannes Schill

fix: Clean up per PR feedback. Thanks @dprokop

parent f428db28
import React, { Component } from 'react';
import { Component } from 'react';
interface ErrorInfo {
componentStack: string;
......@@ -19,10 +19,10 @@ interface State {
}
class ErrorBoundary extends Component<Props, State> {
constructor(props) {
super(props);
this.state = { error: null, errorInfo: null };
}
readonly state: State = {
error: null,
errorInfo: null,
};
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
this.setState({
......@@ -32,15 +32,12 @@ class ErrorBoundary extends Component<Props, State> {
}
render() {
const { children } = this.props;
const { error, errorInfo } = this.state;
return (
<>
{this.props.children({
error,
errorInfo,
})}
</>
);
return children({
error,
errorInfo,
});
}
}
......
......@@ -10,10 +10,6 @@ import { Options } from './types';
interface Props extends PanelProps<Options> {}
export class GraphPanel extends PureComponent<Props> {
constructor(props: Props) {
super(props);
}
render() {
const { timeSeries, timeRange, width, height } = this.props;
const { showLines, showBars, showPoints } = this.props.options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment