asyncView.tsx 608 B

12345678910111213141516171819202122
  1. import AsyncComponent from 'sentry/components/asyncComponent';
  2. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  3. export type AsyncViewState = AsyncComponent['state'];
  4. export type AsyncViewProps = AsyncComponent['props'];
  5. export default class AsyncView<
  6. P extends AsyncViewProps = AsyncViewProps,
  7. S extends AsyncViewState = AsyncViewState
  8. > extends AsyncComponent<P, S> {
  9. getTitle() {
  10. return '';
  11. }
  12. render() {
  13. return (
  14. <SentryDocumentTitle title={this.getTitle()}>
  15. {this.renderComponent() as React.ReactChild}
  16. </SentryDocumentTitle>
  17. );
  18. }
  19. }