Can I have multiple events in a components?
Yes , you can have multiple events in a component . What is it you 're trying to do with the events in a component ? When you say "why do I have to type events " , do you mean when creating an event in a component and giving it a name ? If so , this is because you need to trigger an event from a component in order to send data out of it to the page or a parent component , so the event you create is up to you in terms of what it 's called or what it sends back . Common examples are click events e .g . for a button component . You create an event called something like "onClick " or "buttonClick " and trigger it from within the component e .g . on click of a button , trigger the "buttonClick " event . This means when you add a button to the page , you can use the event to do further actions . I can demo an example if you like ? Here 's a more complicated example : https://www.tella.tv/video/components-and-events-part-2-hpmk And here 's a link to Andreas ' video regarding abstraction : https://youtu.be/PQjMZ_0ju1g?si=f-5rYCjxItt6DthT Yes , it 's likely you will need to trigger the click event from the component and then update the data /state at the page level . Like I mentioned in my first video , it really depends on the scope of your application and what you need it to do as to how to handle things within the context of a component or at page level . Looking at the variable naming , it looks like you might be creating a number of different variables for each item you 're inputting , etc . I 'd highly recommend looking at data structures (objects and arrays ) to help manage this . It means fewer variables and less complex logic in the long run . See https://youtu.be/8gOxQhhVohA?si=oKGM1E_8SK-gocc3 If you 're going to use the variables in the component , you 'll need to recreate them or copy /paste them in the component . Then you 'll need an event to send the data back to the page if you 're planning on updating an API or something like that . Hard to say without access to your project and broader understanding of what you 're trying to achieve . Sadly I 'm not available for a call this evening . If you can provide an explainer via video , this will give me the chance to have a look when I get a bit more time . If you do that , please be as descriptive as possible in terms of the problem you 're trying to solve and I 'll try to return a video with some suggestions . Failing that , there may be others in the community here willing to help you out . π You have a component with an input and a search dropdown and a button right ? The component itself should handle all of that logic and just pass up the selected item in the event That way if you repeat the component , each one will handle its own state /variables Based on the look of your element tree , you could use some refactoring and create a few components