on mouse leave javascript code example

Example 1: detect mouse javascript

/* npm i tappify */
import Tappify from "tappify";

/* Only works in react.js */
function myComponent() {
  return <>
    <Tappify.Finger>
      Client is using finger *tap tap*
    </Tappify.Finger>
 
    <Tappify.Cursor>
      Client is using mouse cursor *click click*
    </Tappify.Cursor>
  </>
}
//more info: https://github.com/asplunds/tappify

Example 2: mouseout vs mouseleave js event

The mouseout event triggers when the mouse pointer leaves any
child elements as well the selected element.
The mouseleave event is only triggered when the mouse pointer 
leaves the selected element.