asyncView.tsx 646 B

12345678910111213141516171819202122232425
  1. import * as React from 'react';
  2. import DocumentTitle from 'react-document-title';
  3. import AsyncComponent from 'app/components/asyncComponent';
  4. type AsyncViewState = AsyncComponent['state'];
  5. type AsyncViewProps = AsyncComponent['props'];
  6. export default class AsyncView<
  7. P extends AsyncViewProps = AsyncViewProps,
  8. S extends AsyncViewState = AsyncViewState
  9. > extends AsyncComponent<P, S> {
  10. getTitle() {
  11. return '';
  12. }
  13. render() {
  14. const title = this.getTitle();
  15. return (
  16. <DocumentTitle title={`${title ? `${title} - ` : ''}Sentry`}>
  17. {this.renderComponent() as React.ReactChild}
  18. </DocumentTitle>
  19. );
  20. }
  21. }