In this video we are going to learn about dom events.
All React events are written in camelCase and.
React event handlers are written inside curly braces.
Lets see how can we use dom event.
So go to the project and just open Post Component.
Now inside the post Component lets add abutton as following.


<button onClick={} >Click Here</button>


Inside the curley braces add the clickhandler method so first create click handler method.
So just type here.


handleClick(e){
console.log(this.state);
}


Now add this handleClick method inside the curley bracket.

<button onClick={this.handleClick} >Click Here</button>


Now lets see the result.
Go to the browser and here you can see the button.
Now make visible the console.
For that just right click and choose inspect element.
Now click on console tab.
Now click on button you can see here the state elements.
Alright now see the onMouseOver event.
For that just create another button.


<button onMouseOver={} >Mouse Hover Here</button>


Now create a function for handeling the mouse over event.


handleMouseOver(e)
{
console.log(e.target,e.pageX)
}

Now add this method to the button.


<button onMouseOver={this.handleMouseOver} >Mouse Hover Here</button>


Lets check it.
So switch to the browser and here just hover on this button you can see on console page x value.
Now let see the onCopy event.
So here just create a paragraph.


<p onCopy={} >This is a test paragraph</p>


Now create method for handle the Copy event, so just write here.


handleCopy(e){
console.log('Paragraph has been copied!');
}


Now lets check so switch to the browser and here just.
Try to copy this paragraph.
You can see here the message paragraph has been copied.
So in this way you can use dom event in react.