Is it possible to update the children of an existing component using the plugin API?

Is it possible to update the children of an existing component using the plugin API?

I am working on a plugin that generates icon components for a library from raw SVGs. The generation part is pretty straightforward, but I’d also like to be able to update the existing Figma components when there are changes to the SVGs without breaking the component instances.

The children property is readonly and I haven’t been able to find another way to remove the existing children of the ComponentNode so that I can add the updated children. Is there something I missed?

Call remove() on the child node you want.

Thanks! I actually just figured it out :sweat_smile: Don’t know why I struggled with that one for so long.