How to use the react-dom.unstable_renderSubtreeIntoContainer function in react-dom

To help you get started, we’ve selected a few react-dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ag-grid / ag-grid-react / src / agReactComponent.ts View on Github external
// so user can have access to the react container,
        // to add css class or style
        params.reactContainer = this.eParentElement;

        let self = this;
        const ReactComponent = React.createElement(this.reactComponent, params);
        if (!this.parentComponent) {

            // MUST be a function, not an arrow function
            ReactDOM.render(ReactComponent, this.eParentElement, function () {
                self.componentRef = this;
            });
        } else {

            // MUST be a function, not an arrow function
            ReactDOM.unstable_renderSubtreeIntoContainer(this.parentComponent, ReactComponent, this.eParentElement, function () {
                self.componentRef = this;
            });
        }
    }
github researchspace / researchspace / researchspace / web / src / main / components / timeline / SemanticTimeline.tsx View on Github external
return (item: any, element: Element, changedData?: any) => {
    if (!changedData) { return; }
    const markup = renderData(item);
    ReactDOM.unstable_renderSubtreeIntoContainer(parent, markup, element);
    // Cast return type to any as
    // there is incomplete function type definition of TimelineOptionsTemplateFunction,
    // the documentation states that the function can return string or ReactDOM.render() result.
    //
    // In React 16.x rendering using ReactDOM always returns null inside lifecycle methods,
    // however if we return a non-Element object, Vis.js will call template function again
    // without `changedData` specified.
    return {} as any;
  };
}
github bootstrap-styled / v4 / src / components / Modal / Modal.js View on Github external
renderIntoSubtree() {
    ReactDOM.unstable_renderSubtreeIntoContainer(
      this,
      this.renderChildren(),
      this._element  // eslint-disable-line no-underscore-dangle
    );

    // check if modal should receive focus
    if (this._focus) {  // eslint-disable-line no-underscore-dangle
      this._dialog.parentNode.focus();  // eslint-disable-line no-underscore-dangle
      this._focus = false;  // eslint-disable-line no-underscore-dangle
    }
  }
github Khan / wonder-blocks / packages / wonder-blocks-tooltip / components / tooltip-portal-mounter.js View on Github external
_refreshPortalContent() {
        const {children} = this.props;
        if (!this._destination || !children) {
            return;
        }

        // Now we can render the portal content.
        // We have to render the subtree like this so that everything works as
        // expected.
        // See https://github.com/tajo/react-portal/blob/master/src/LegacyPortal.js
        ReactDOM.unstable_renderSubtreeIntoContainer(
            this,
            children,
            this._destination,
        );
    }
github wix-playground / stylable-components / src / components / portal / portal.tsx View on Github external
private renderPortal() {
        ReactDOM.unstable_renderSubtreeIntoContainer(this, this.portalContent, this.getContainer());
    }
github atom / github / lib / views / portal.js View on Github external
renderPortal(props) {
    this.subtree = ReactDom.unstable_renderSubtreeIntoContainer(
      this, props.children, this.node,
    );
  }
github skbkontur / retail-ui / packages / retail-ui / components / RenderContainer / RenderContainer.js View on Github external
_renderChild() {
    ReactDOM.unstable_renderSubtreeIntoContainer(
      this,
      
        {this.props.children}
      ,
      this._domContainer
    );
  }
}
github EleanorMao / asumi-ui / src / component / modal / index.js View on Github external
function renderComponent(instance) {
    if (instance.props.visible) {
        if (!instance.container) {
            instance.container = instance.getContainer();
        }
        ReactDOM.unstable_renderSubtreeIntoContainer(instance,
            , instance.container);
    }
}