deprecatedAsyncView.tsx 857 B

1234567891011121314151617181920212223242526272829
  1. import DeprecatedAsyncComponent from 'sentry/components/deprecatedAsyncComponent';
  2. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  3. export type AsyncViewState = DeprecatedAsyncComponent['state'];
  4. export type AsyncViewProps = DeprecatedAsyncComponent['props'];
  5. /**
  6. * @deprecated use useApiQuery instead.
  7. *
  8. * Read the dev docs page on network requests for more information [1].
  9. *
  10. * [1]: https://develop.sentry.dev/frontend/network-requests/
  11. */
  12. export default class DeprecatedAsyncView<
  13. P extends AsyncViewProps = AsyncViewProps,
  14. S extends AsyncViewState = AsyncViewState,
  15. > extends DeprecatedAsyncComponent<P, S> {
  16. getTitle() {
  17. return '';
  18. }
  19. render() {
  20. return (
  21. <SentryDocumentTitle title={this.getTitle()}>
  22. {this.renderComponent() as React.ReactChild}
  23. </SentryDocumentTitle>
  24. );
  25. }
  26. }