I have the following code:
const components = findComponentsInPage(componentPage);
const selectedComponent = components.filter((component) => {
return component.name === nameComponent;
})[0];
try {
console.log('Creating component instance...');
const componentInstance = selectedComponent.instance.createInstance();
selectedComponent has the following interface:
interface IComponent {
name: string;
instance: ComponentNode;
}
So as you can see, I’m passing the ComponentNode to createInstance() function. However, I get the following error:
Any ideas? I’m recovering the ComponentNode from the page.children by their name.