當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript react-dom.unmountComponentAtNode函數代碼示例

本文整理匯總了TypeScript中react-dom.unmountComponentAtNode函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript unmountComponentAtNode函數的具體用法?TypeScript unmountComponentAtNode怎麽用?TypeScript unmountComponentAtNode使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了unmountComponentAtNode函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: onDisposeCell

 @override
 public onDisposeCell(event: IFieldCustomizerCellEventParameters): void {
   // This method should be used to free any resources that were allocated during rendering.
   // For example, if your onRenderCell() called ReactDOM.render(), then you should
   // call ReactDOM.unmountComponentAtNode() here.
   ReactDOM.unmountComponentAtNode(event.cellDiv);
   super.onDisposeCell(event);
 }
開發者ID:AdrianDiaz81,項目名稱:sp-dev-fx-extensions,代碼行數:8,代碼來源:ToggleFieldCustomizer.ts

示例2: removeLastTemplate

export function removeLastTemplate() {
  if (_lastTemplateDiv) {
    ReactDOM.unmountComponentAtNode(_lastTemplateDiv);
    if (_lastTemplateDiv.parentElement) {
      _lastTemplateDiv.parentElement.removeChild(_lastTemplateDiv);
    }
    _lastTemplateDiv = null;
  }
}
開發者ID:breezeflow,項目名稱:breezeflow,代碼行數:9,代碼來源:test-util.ts

示例3:

    childWindow.onbeforeunload = () => {
      if (popoutContainer) {
        ReactDOM.unmountComponentAtNode(popoutContainer)
      }

      if (_.isFunction(options.onClosing)) {
        options.onClosing()
      }
    }
開發者ID:carlosrfernandez,項目名稱:ReactiveTraderCloud,代碼行數:9,代碼來源:browserPopoutService.ts

示例4:

 scope.$on('$destroy', () => {
   if (!attrs.onScopeDestroy) {
     ReactDOM.unmountComponentAtNode(elem[0]);
   } else {
     scope.$eval(attrs.onScopeDestroy, {
       unmountComponent: ReactDOM.unmountComponentAtNode.bind(this, elem[0]),
     });
   }
 });
開發者ID:ArcticSnowman,項目名稱:grafana,代碼行數:9,代碼來源:ng_react.ts

示例5: onPanelTeardown

  onPanelTeardown() {
    this.thresholdManager = null;
    this.timeRegionManager = null;

    if (this.plot) {
      this.plot.destroy();
      this.plot = null;
    }

    this.tooltip.destroy();
    this.elem.off();
    this.elem.remove();

    ReactDOM.unmountComponentAtNode(this.legendElem);
  }
開發者ID:CorpGlory,項目名稱:grafana,代碼行數:15,代碼來源:graph.ts

示例6: onRender

  onRender(renderData) {
    this.data = renderData || this.data;
    if (!this.data) {
      return;
    }

    this.annotations = this.ctrl.annotations || [];
    this.buildFlotPairs(this.data);
    const graphHeight = this.elem.height();
    updateLegendValues(this.data, this.panel, graphHeight);

    if (!this.panel.legend.show) {
      if (this.legendElem.hasChildNodes()) {
        ReactDOM.unmountComponentAtNode(this.legendElem);
      }
      this.renderPanel();
      return;
    }

    const { values, min, max, avg, current, total } = this.panel.legend;
    const { alignAsTable, rightSide, sideWidth, sort, sortDesc, hideEmpty, hideZero } = this.panel.legend;
    const legendOptions = { alignAsTable, rightSide, sideWidth, sort, sortDesc, hideEmpty, hideZero };
    const valueOptions = { values, min, max, avg, current, total };
    const legendProps: GraphLegendProps = {
      seriesList: this.data,
      hiddenSeries: this.ctrl.hiddenSeries,
      ...legendOptions,
      ...valueOptions,
      onToggleSeries: this.ctrl.onToggleSeries,
      onToggleSort: this.ctrl.onToggleSort,
      onColorChange: this.ctrl.onColorChange,
      onToggleAxis: this.ctrl.onToggleAxis,
    };

    const legendReactElem = React.createElement(LegendWithThemeProvider, legendProps);
    ReactDOM.render(legendReactElem, this.legendElem, () => this.renderPanel());
  }
開發者ID:CorpGlory,項目名稱:grafana,代碼行數:37,代碼來源:graph.ts

示例7: unmountElement

 unmountElement() {
   ReactDOM.unmountComponentAtNode(this.getRootElement());
 }
開發者ID:syesildag,項目名稱:jreact,代碼行數:3,代碼來源:jreactWrapper.ts

示例8: unmount

 public unmount() {
     ReactDOM.unmountComponentAtNode(this.container);
 }
開發者ID:infoarte,項目名稱:WIP,代碼行數:3,代碼來源:harness.ts

示例9:

 params.api.addVirtualRowListener('virtualRowRemoved', params.rowIndex, () => {
     ReactDOM.unmountComponentAtNode(eCell);
 });
開發者ID:chejen,項目名稱:ag-grid-react,代碼行數:3,代碼來源:ReactCellRendererFactory.ts

示例10: removeViewFromDom

export function removeViewFromDom(parentElement: HTMLElement, childElement: HTMLElement): Promise<any> {
  ReactDOM.unmountComponentAtNode(childElement);
  parentElement.removeChild(childElement);
  return Promise.resolve();
}
開發者ID:GHernansanz,項目名稱:ionic,代碼行數:5,代碼來源:react-framework-delegate.ts


注:本文中的react-dom.unmountComponentAtNode函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。