I am working on a figma plugin development, since I am using figma
plugin api, as per below code Im trying to access a specific node in
the mainLayer children, but when mainLayer is consoled it shows
children with length 2 which has a ‘readout-layer’ name node, but
when readoutLayer is consoled it is empty.
const mainLayer = figma.currentPage.children.find((layer) => layer.name === 'main-layer') as GroupNode;
let readoutLayer = mainLayer.children.filter((layer) => layer.name === 'readout-layer') as GroupNode[];
console.log("==mainLayer==>",mainLayer) // GroupNode {id: '318:1123'} is consoled
console.log("==mainLayer==>",mainLayer.children) // [GroupNode] is consoled
console.log("==readoutLayer==>",readoutLayer ) // [] is consoled
is there any reason why ‘readout-layer’ named node is not available,
while mainLayer has it when consoled individually. Also I dont want to
use settimeout functions since I dont want delays and control moving
to next set of code line