Hello and welcome to the course from dishcloth in this lecture will look tasty and Will Barton and how
callbacks look good.
So we have initialized our up and down our imports.
So let's set our layout.
So let's start with the idea.
So I'd equal to parent reading then defining the children, property, children equal to school.
Yes, so now will create a button using a stimulus component.
So that is a stimulus button, this will create a button for us.
Now, the first argument is, as always, Diagne, I'd call the to waste human life one button and then
there is a children property of Doverton.
So this is what a user will see on the in this text.
So children equal to let's say we see click doverton.
Exclamation.
So now let's break the line, ASTM a lot bigger and now let's define a company where we will see the
number of times the pattern is clear.
So estimate or depth and then idea of making a company, which is, again, output put text.
And put a text and then next, the final callbacks at that call callback and then the first argument,
which is output output would contain the component data.
So we will be updating the components of component ideas would be of the component.
So the component it is output hyphen text.
And then there is component property, so, for example, in the properties children that we would be
updating and then initializing another property, which is input, input argument of my callback.
So the component idea will be my idea of esteemable button.
So this would be esteemable, a fun button, and the component property is the property of this button.
So we are saying when will click the button?
This will get updated so as to load button as a property which is and click and underscore clicks.
So this property keeps account on what is the number of clicks on the button.
So let's take two and clicks.
Now let's define our function.
So def then the name of that function which is button underscore update, then the argument that there
would be in this function.
So let's say it's value, so NPLEX would pass to value argument.
So we will be using that and the return values are what will return is again the stimulative component.
So within that they will be writing the click count.
So value properties are numeric, so we'll convert that into a string for my dev.
So let's start value.
This will convert value into a thing then.
Plus, so will we open the thing using plus and then CLECs again as my string.
So what this will do is this will return CLECs count to my dev component.
So now let's run up and see how this will look in our browser so we can see by default it is none,
none clicks.
So when when I click on the button then the counter would start from one one click to click and then
three click for.
So what if I want to set the initial value to zero norten so there is a property and clicks which I
can set to zero and clicks equal to zero.
So now what this will do is this will initialize it to zero.
Let me return and show you.
Let's give a speech here.
Right.
So now what will see.
The default value of my clicks would be zero.
Let's refresh.
So now it's starting from zero one two.
So you can use this as a submit button in your forms and then when you click submit, the callback will
get triggered and so on.
So in this section, we looked at how we can use a stimulus button with the callback, how the property
and clicks changes and it helps us to create or trigger the callbacks.
So that's all from this lecture.
Let's meet in the next one.
Happy learning.