refactor: tighten types and reuse instrument UI
This commit is contained in:
@@ -24,15 +24,15 @@ class Boundary extends Component<BoundaryProps, State> {
|
||||
return { hasError: true };
|
||||
}
|
||||
|
||||
state: State = { hasError: false };
|
||||
override state: State = { hasError: false };
|
||||
|
||||
componentDidUpdate(previousProps: BoundaryProps) {
|
||||
override componentDidUpdate(previousProps: BoundaryProps) {
|
||||
if (previousProps.routeKey !== this.props.routeKey && this.state.hasError) {
|
||||
this.setState({ hasError: false });
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
override render() {
|
||||
return this.state.hasError
|
||||
? <RouteErrorFallback authenticated={this.props.authenticated} />
|
||||
: (
|
||||
|
||||
Reference in New Issue
Block a user