Skip to main content
Question

Type 'SceneNode' is not assignable to type 'ComponentNode'

  • April 13, 2022
  • 1 reply
  • 1563 views

kmckiern

I’m creating a variable from a selected component

const selectedComponent: ComponentNode = figma.currentPage.selection[0];

However, I’m hitting the following type error:

Type 'SceneNode' is not assignable to type 'ComponentNode'.

A SceneNode is the union over many node types, including ComponentNode [source]. So, this error seems erroneous.

Perhaps it’s an issue with the current version of @figma/plugin-typings?

1 reply

Gleb
  • Power Member
  • 4706 replies
  • April 13, 2022

Reply


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