findChild
Searches the immediate children of this node (i.e. all page nodes, not including their children). Returns the first page for which callback
returns true.
Supported On:
Signature
findChild(callback: (node: PageNode) => boolean): PageNode | null
Parameters
callback
A function that evaluates whether to return the provided node
.
Remarks
This function returns null
if no matching node is found.
Example: find the first empty page.
const colors = figma.currentPage.findChild(n => n.children.length === 0)