VOOZH about

URL: https://www.geeksforgeeks.org/reactjs/react-onpointerup-event/

⇱ React onPointerUp Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

React onPointerUp Event

Last Updated : 26 Jul, 2024

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 button released after clicked is detect from mouse.

Return type:

  • event: It is an event object containing information about the event like target element and values

Example 1 : In this example, we implemented an area where the user will click any button, and in the event, the user will get numbers (which can be 0, 1, or 2), and accordingly, we are assuming which button is clicked.

Output:

👁 Animation

Example 2: In this example, we implemented an area where users can click and detect the onPointerUp event that is fired through an alert.

Output:


Comment
Article Tags: