I’m creating some component set nodes at runtime composed of components from some external (team) library; when I try to set
myComponentNode.reactions = reactions;
It still gave me “Can’t assign reactions because it’s a read only property.”
Thanks a lot for the trick!
I tried the same thing, for both a local and external component, but I got this instead:
figma_app.03a53ce71eac9dcafba105307c26f2a0.min.js.br:831 Uncaught Error: in set_reactions: Reaction at index 0 was invalid
at ComponentNode.set_reactions [as reactions] (figma_app.03a53ce71eac9dcafba105307c26f2a0.min.js.br:831)
at :1:43
It turned out that I had the wrong destinations (that were not the children of the same component set node) for the reaction. Figma is smart enough to know which ones are valid destinations, although the error message appears to be confusing…
In my VS Code, it still says “TS2540: Cannot assign to ‘reactions’ because it is a read-only property” both in the editor and on build, but actually it does work in Figma designer!