Skip to main content
Question

Cloning an instance node doesn't create a separate instance

  • February 15, 2024
  • 4 replies
  • 271 views

aparnell-intapp

In an internal plugin I’m building I was using .clone() on an instance node to make multiple instances, but then when I would try to manually change properties on one instance in Figma, all of the other clones would have that property change too.

Further inspection revealed that all of the cloned instances have the same node id.

In the mean time I can work around this by creating new instances of the main component, but I’ll also have to set the overrides I was trying to preserve by cloning an existing instance.

This topic has been closed for replies.

4 replies

tank666
  • 4873 replies
  • February 15, 2024

aparnell-intapp

You’re right there’s a slight correction I have to make.

All of the cloned instances have a unique id. BUT if those clone instances are together inside a component and then I make an instance of that component, THEN all of the cloned instances share a single id.

Cloned instances inside a component: unique ids

Those same cloned instances inside an instance of that component: All 4 have the same id I15:10512;7140:69940


aparnell-intapp

Here’s a couple videos demonstrating what I was describing when I said “when I would try to manually change properties on one instance in Figma, all of the other clones would have that property change too.”

Changing variant: All of the clones change at the same time AND change their layer name to “Cell Clone 1” (the name of the first of the clones)

Overriding text: Text overrides simultaneously in all the clones


tank666
  • 4873 replies
  • February 15, 2024

Could you share a link to the example file?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings