Pressable does not have onHoverIn/onHoverOut props, while Pressability does

1
closed
Saadnajmi
Saadnajmi
Posted 1 month ago

Pressable does not have onHoverIn/onHoverOut props, while Pressability does #32406

Several desktop forks (react-native-macos, react-native-windows, react-native-web) support mouse events, and while the stock Pressable component has the ability to support mouse events, it seems we aren't forwarding some props properly from Pressable -> Pressability.

Pressability will calculate onMouseEnter / onMouseLeave event handlers based on the onHoverIn/onHoverOut callbacks passed into PressabilityConfig. https://github.com/facebook/react-native/blob/ad0d4534a751ed05f84ff971714c8f7a4d1deb3a/Libraries/Pressability/Pressability.js#L552 However, Pressable does not pass take in onHoverIn/onHoverOut props to pass to PressabilityConfig, so we can't take advantage of this functionality. I made PR #32405 to address the issue. I created this bug meanwhile to track this issue