Is there a way to traverse through masterComponents
without having an instance in the document first?
Also, will a component's UUID change when the component is updated, and will that UUID be the same across all consumers of that component?
Is there a way to traverse through masterComponents
without having an instance in the document first?
Also, will a component's UUID change when the component is updated, and will that UUID be the same across all consumers of that component?
Figured it out. Wrote a utility function for it
export function traverse(node: any) {
if ("children" in node) {
if (node.type !== "INSTANCE") {
for (const child of node.children) {
traverse(child)
if (child.mainComponent) {
console.log(`name: ${child.mainComponent.name}`)
console.log(`key: ${child.mainComponent.key}`)
}
}
}
}
}