4.1 listen to events and use of managers development

All right we’ll end up in the item expense and in it we will also add a button below this div just before closing the card like this and we’ll mark change title and if we go here It puts the headline change behind the price and this that we’re going to do we’re going to add in button ond click we’ll put the brackets and after the brackets We’ll put it like the last shot. an arrow function and then after the brackets we’ll put console.log in clicked parentheses

and normally it should be good this is one of the first options you can do with the button and the second you can use on will keep the One Click to remove all that and inside we’re going to tag clickHandler this is an event there you see that it is not recognized because at the top of the return we go add a const clickHandler is equal In parentheses we put a hook arrow function and we put console.log in parentheses clicked And if you look at it, it’s no longer

so that’s how we can add from event headphones to our elements and to all and HTML integrate this is a function that is not called elsewhere in our code this is a function that we attach to an event headset so that she or finally call reactively when the event produces this is why I appoint my duties as managers events like these, ending with Handler. But again it’s just my preference you see it in some projects might want consider doing so but it is not mandatory now with that we know how we can react to events how can we change now what belongs screen however we will see that in the next class.