Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Last active August 30, 2022 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/d6673d674311858f26014b516c30f6f0 to your computer and use it in GitHub Desktop.
Save NetanelBasal/d6673d674311858f26014b516c30f6f0 to your computer and use it in GitHub Desktop.
import { Component, ElementRef, inject } from '@angular/core';
import { App } from '@myorg/app-name';
import { NgReact } from '@myorg/ng-react';
@Component({
standalone: true,
template: ``
})
export class TodosPageComponent {
private ngReact = inject(NgReact);
private root = this.ngReact.createRoot(inject(ElementRef).nativeElement);
ngOnInit() {
this.ngReact.render(this.root, App)
}
ngOnDestroy() {
this.root.unmount();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment