Created
April 17, 2019 11:55
-
-
Save maxkoretskyi/f8a0621fdc9369f807217cdba5535075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ReactComponent extends BaseReactComponent { | |
private eParentElement!: HTMLElement; | |
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