Instagram
youtube
Facebook
Twitter

Events

Events

  • An event performs an action based on user events.
  • Example: a mouse click, loading a web page, and so on.
  • Events are written in camelCase syntax in react. Example: onClick.
<button onClick={shoot}>Take the Shot!</button>

Passing Arguments

  • Pass an argument to an event handler using the arrow function.
hello = (val) => "Hello " + val;