renderPipelineView.tsx 599 B

1234567891011121314151617
  1. import {createRoot} from 'react-dom/client';
  2. import {ROOT_ELEMENT} from 'sentry/constants';
  3. import type {PipelineInitialData} from 'sentry/types/system';
  4. import PipelineView from 'sentry/views/integrationPipeline/pipelineView';
  5. function renderDom(pipelineName: string, props: PipelineInitialData['props']) {
  6. const rootEl = document.getElementById(ROOT_ELEMENT)!;
  7. const root = createRoot(rootEl);
  8. root.render(<PipelineView pipelineName={pipelineName} {...props} />);
  9. }
  10. export function renderPipelineView() {
  11. const {name, props} = window.__pipelineInitialData;
  12. renderDom(name, props);
  13. }