I need to know some API methods that can replace one instance with other instances, I only found the swapComponent method, but it seems to only replace a single component with another single component, I want to be able to replace one component with multiple components.
I’m developing a plugin using the Figma API, the goal is to parse the user input component tree JSON to draw mockups in Figma. I have a Accordion component already in lib to ensure a uniform style of reuse and expand the content when it is in the Open state, it is pre-defined as a Slots instance like this. If the user wants to replace the Slots with a Button instance, I can use the swapComponent method. But if the user wants to replace the Slot with something more complex, like a Frame with multiple child elements, I can’t find a way to do that.
In the page design, like Tab, Accordion, Modal, these types of complex components may have internal subcomponents nested with other more complex components, and I need to deal with this kind of problem urgently.