I’ve created two separate components (dummy-pages-1 and dummy-pages-2) with three color variants each.
I’m using a ‘selectedPage’ variable to swap between variants of dummy-pages-1 on button clicks, but I can’t get the buttons for dummy-pages-2 variants to work.
How can I modify my setup to allow switching between variants from both components using a single instance on the stage?
Try merging them? If they’re the same they shouldn’t be in 2 different sets.
Is there a workaround to avoid merging these components, as I plan to keep them in separate page?
You can merge them and add another property called page if you want to set it up per page. On development, they might try to use the same component (they’ll merge them) anyways.
And, they should work the same if you’re using selectedPage as a string variable (no matter what page are they).
e.g.
Button 1.on click = set variable “selectedPage” to “blue”,
Button 2.on click = set variable “selectedPage” to “yellow”,
Button 3.on cick = set variable “selectedPage” to “red”,
Button 4.on click = set variable “selectedPage” to “purple”,
Button 5.on click = set variable “selectedPage” to “green”,
Button 6.on click = set variable “selectedPage” to “pink”
There might be issue directly on your prototyping settings, because they should work. I can’t know until i see the prototype settings.