Figma Support Forum

Is it possible to remove a childNode of InstanceNode by calling remove

Is it possible to remove a childNode of an instanceNode by calling remove method on the node. E.g.

  • component node(with id 1:1) which has a child node (with id 1:2)
  • instance node (with id 1:3) which has a child node (with id I1:3;1:2)

Whether calling figma.getNodeById('1:2').remove() or figma.getNodeById('I1:3;1:2').remove() both resulting in Uncaught Error: in remove: Removing this node is not allowed. However, toggling visibility works fine.

AFAIK, it’s not possible to remove a layer (child) from an instance even doing it manually (selecting the layer and pressing del or Backspace hides it)