Merge pull request #3273 from influxdata/fixes/component-error-handling-names
Show proper name for components with error handlingpull/3280/head
commit
b3c3a60c30
|
@ -7,6 +7,10 @@ export function ErrorHandling<
|
|||
T extends {new (...args: any[]): React.Component<P, S>}
|
||||
>(constructor: T) {
|
||||
class Wrapped extends constructor {
|
||||
public static get displayName(): string {
|
||||
return constructor.name
|
||||
}
|
||||
|
||||
private error: boolean = false
|
||||
|
||||
public componentDidCatch(error, info) {
|
||||
|
@ -29,5 +33,6 @@ export function ErrorHandling<
|
|||
return super.render()
|
||||
}
|
||||
}
|
||||
|
||||
return Wrapped
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue