Profile Photo

Reactjs events

Created on: Sep 19, 2024

React Events are user interactions with the web application, such as clicks, keyboard input, and other actions that trigger a response in the user interface.

React events are named using camelCase, rather than lowercase.

Below is a example:

import "./App.css"; function App() { const handleOnSubmit = (e) => { e.preventDefault(); console.warn("You clicked on submit function"); }; return ( <> <h1>This is React WebApp </h1> <form action=""> <button type="submit" onClick={handleOnSubmit}> submit </button> </form> </> ); } export default App;

Reference