onMouseEnter/onMouseLeave for genereric Views 📱🖱️
Introduction
You can connect mouse to mobile devices via USB or Bluetooth but while working with generic view, hover events for that are not exposed.
Example of discord app's usage for hover events:
Reference
Android OnHoverListener: https://developer.android.com/reference/android/view/View.OnHoverListener
IOS UIHoverGestureRecognizer: https://developer.apple.com/documentation/uikit/uihovergesturerecognizer
+1 and it's not just a mouse this would be useful for:
- Many Android devices have pens with some form of "air hover" feature, e.g. the Samsung Galaxy s-pen is very widely used, and I believe there are others too (e.g. high-end tablets marketed at digital artists?).
- I believe the Apple Pencil (and connected mouse) does something similar on iOS? iOS has UIHoverGestureRecognizer like Android's View.OnHoverListener you mentioned in the issue.
I believe these all trigger the same hover events as a connected mouse. Many pure-native apps support hover events perfectly for these.
+1 and it's not just a mouse this would be useful for:
- Many Android devices have pens with some form of "air hover" feature, e.g. the Samsung Galaxy s-pen is very widely used, and I believe there are others too (e.g. high-end tablets marketed at digital artists?).
- I believe the Apple Pencil (and connected mouse) does something similar on iOS? iOS has UIHoverGestureRecognizer like Android's View.OnHoverListener you mentioned in the issue.
I believe these all trigger the same hover events as a connected mouse. Many pure-native apps support hover events perfectly for these.
Excellent point. Thanks for adding to the discussion!
Looking at the react-native code I found that this kind of pointer event seems to be under development and we will get there soon.
https://github.com/facebook/react-native/commit/6e5cefe604786c1883ca09febee0792af7ce1b34
Btw, seems @lunaleaps is actively working on it... Thank you a lot ❤️

https://github.com/facebook/react-native/commits?author=lunaleaps
@vincentriemer and I are working on implementing the PointerEvent spec and have some coarse implementation of it. You can opt into it using ReactFeatureFlag dispatchPointerEvents on Android, there's an equivalent flag in iOS.
https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native
@runtothedoor Let us know if you end up trying it and have any thoughts: https://github.com/react-native-community/discussions-and-proposals/discussions/557
I'll close this and we can continue discussion there.