Skip to main content
Question

How to get a child component in master component

  • November 15, 2023
  • 0 replies
  • 340 views

Tomas_Bana

Hi all,
I just started with Figma API, and trying get access to the Child component in main component. For example: I need to get component Date in main component Row.

//main component
const row = Figma.root.findOne(node => node.type == “COMPONENT” && node.name == “MatchRows”) as ComponentNode;

//child
const rowDate = row.findChild(node => node.type == “COMPONENT” && node.name == “Date”) as ComponentNode;

This code got me a main component (Row, this component has four children), but I don’t know how to get the child component Date.

Thanks for help

This topic has been closed for replies.