I feel like this should be extremely easy but im struggling to work it out.
Ive created a component. Within the component is an icon control that I want to switch between two different icon images each time it is clicked. Its basically a toggle.
If I was doing this outside of a component I'd create a context variable that would be flipped between true or false with each icon onselect(), and have the icon shown be based on the current value of that context variable. How can I achieve the same in a component, considering context variables aren't allowed within them?
I feel like I need to be creating a property for the component but i just dont know which one, or how to update it through the icon being selected.

Report
All responses (
Answers (