Skip to content

Instantly share code, notes, and snippets.

@maxkoretskyi
Created April 17, 2019 15:04
Show Gist options
  • Save maxkoretskyi/d542245e7ba9727be307ccf496fd2446 to your computer and use it in GitHub Desktop.
Save maxkoretskyi/d542245e7ba9727be307ccf496fd2446 to your computer and use it in GitHub Desktop.
export class ReactComponent extends BaseReactComponent {
private createReactComponent(params: any, resolve: (value: any) => void) {
const ReactComponent = React.createElement(this.reactComponent, params);
const portal: ReactPortal = ReactDOM.createPortal(
ReactComponent,
this.eParentElement
);
this.portal = portal;
this.parentComponent.mountReactPortal(portal!, this, resolve);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment