In my figma plugin,
I did,
let targetNode = figma.currentPage.findAll((node) => node.name === data.target);
I can access a node in one of the layer. I am trying to hide everything and from this node, by traversing to root, to set visibility. But I get error to access parent in loop.
Basically trying to do below in a loop
console.log(“current page”,figma.root.name)
let node = targetNodeN0]
node.visible=true
let nodep = node.parent
if(nodep?.type ==“FRAME”)
nodep.visible=true
let nodepp = nodep?.parent
if(nodepp?.type ==“FRAME”)
nodepp.visible=true