React onPointerMove Event Last Updated : 24 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The onPointerMove event in React fires whenever the cursor moves inside the tag or element where the event has been applied. Similar to other events, the onPointerMove takes a function which defines the process/task which has to be applied.Syntax:onPointerMove={function}Parameter : function: The function which has to be called when the mouse is moving (hovering) over the specified element.Return type:event: An event object containing information about the event like target element and valuesExample 1 : In this example, we implemented an area where the user will move their cursor, and that will fire the event, and the function passed to the event will give an alert that the pointer is moving. CSS /*App.css*/ .App { min-width: 30vw; margin: auto; text-align: center; color: green; font-size: 23px; } .Shaded { background-color: lightgray; height: 200px; width: 300px; margin: auto; border-radius: 6px; } JavaScript // App.js import "./App.css" const App = () => { const function1 = (event) => { alert("Pointer is Moving") console.log(event) } return ( <div className="App"> <h1>GeeksforGeeks</h1> <h2>Move Pointer inside the shaded region</h2> <div className="Shaded" onPointerMove={function1}> </div> </div> ); } export default App; Output:Example 2: In this example, we implemented an area where users can move their cursor. When this occurs, an event will fire and "Pointer is moving" will be printed in the console. JavaScript // App.js import "./App.css" const App = () => { const function1 = (event) => { console.log("Pointer is Moving") } return ( <div className="App"> <h1>GeeksforGeeks</h1> <h2>Move Pointer inside the shaded region</h2> <div className="Shaded" onPointerMove={function1}> </div> </div> ); } export default App; Output: Comment More infoAdvertise with us Next Article React onMouseMove Event P prathamgfg Follow Improve Article Tags : Web Technologies ReactJS React Events Similar Reads React onPointerDown Event The onPointerDown event in React fires whenever the pointer (mouse) is down i.e. clicked over the tag or element over which the event has been applied. Similar to other events, we have to provide a function which executes the task or process when the event occurs.Syntax:onPointerMove={function}Param 2 min read React onPointerUp Event React onPointerUp event fires when the mouse button is clicked and released and it detects the right, left, or middle click of the mouse. Similar to other events, we have to provide a function that will execute their process.Syntax:onPointerUp={function}Parameter : function that will call once any b 2 min read React onPointerCancel Event React onPointerCancel fires when a pointer event cancels, like when someone is zoomed into an image and the user suddenly leaves it, which is a part of the onPointerCancel event.Syntax:onPointerCancel={function}Parameter : function that will call once any pointer event cancels.Return type:event: It 2 min read React onMouseMove Event React onMouseMove event detects a mouse movement over an element. The event triggers when the mouse pointer moves while positioned over an element. It is particularly useful where you want to track and respond to the movement of the user's cursor.It is similar to the HTML DOM onmousemove event but u 2 min read React onTouchMove Event React onTouchMove event fires when the user touches and moves the cursor. Similar to other elements in it, we have to pass a function for process execution.It is similar to the HTML DOM ontouchmove event but uses the camelCase convention in React.Syntax:onTouchMove={function}Parameter : function tha 2 min read React onMouseEnter Event React onMouseEnter() is an event handler that triggers when the mouse cursor enters the boundaries of an element. It is particularly useful where you want to initiate actions or display information when the user's cursor hovers over an element. It is similar to the HTML DOM onmouseenter event but us 2 min read Like