swapComponent
Swaps this instance's current main component with componentNode
and preserves overrides using the same heuristics as instance swap in the Figma editor UI. Note that we may update these override preservation heuristics from time to time.
Supported on:
Signature
swapComponent(componentNode: ComponentNode): void
Remarks
Learn more about instance swap and override preservation in our help center. If you do not want to preserve overrides when swapping, you should use mainComponent
, which sets the instance's main component directly and clears all overrides.