Question about Spark; how do I toggle the loading on?
Hey ! I 'm playing around with Spark and some things are clear but some are not . One of these things is the button that has a loading attribute that you can set to true and that it will show the loading animation . But how do I set it to loading ? I tried passing down attributes but that doesn 't work . β 1β 1Yes sorry for the vague explaination @Max Indeed if I set the attribute to true it works , but I don 't know how to set it to true if the component is nested 3 layers deep . for example in this scenario I don 't know how to set the loading to true . Do I create a variable isClicked within the component and set that to true when someone uses the onClick event ? So in other words , I want to set it to loading when someone clicks on the button but I don 't want to do it in a messy way and don 't know what the best practices are π¬ I see π this is not specific to Spark . There are three options : - You can bring your logic closer to the button and don 't have it high up your tree - you can pass down the state from component to component until you reach the button - you use contexts I believe that there are toddle videos on components and contexts available π