I am creating a custom Table of Contents app for my org.
I have an array of page nodes called section
.
Here is my code:
section.forEach((name: string, id: number) => {
let pageLink = figma.createText();
pageLink.fontName = { family: fontName, style: "Regular" };
pageLink.characters = name;
pageLink.hyperlink = { type: "NODE", value: id };
pageLink.textDecoration = "UNDERLINE";
pageLink.fontSize = 16;
sectionFrame.appendChild(pageLink);
});
When I remove the hyperlink, it works fine. When I don’t, the process fails and nothing is rendered to the page.
I have console logged name
and id
inside the loop and it returns good values.
From what I can see in the API docs (and other plugins) this is the correct syntax. Is there some other factor that causes hyperlink to not be available?