mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
4e31fbd39c
Summary: This was all yungsters idea. I blame him. :) Switching Pressable to be a functional component presents a new challenge. ReactNativeTestTools can no longer find its instance because there is no instance Pressable uses forwardRef. We need a way to both find a pressable, and then call the onPress callback if the pressable isn't also disabled. So in DEV (and thus test) we add the pressable config to a secret key on a function passed onto View. The TestTools look for this key on this function, and then can call onPress. Super hacky, but so is all of ReactNativeTestTools. We aren't proud of this. Changelog: [General][Changed]: Added support for Pressable to ReactNativeTestTools.tap Reviewed By: yungsters Differential Revision: D18849358 fbshipit-source-id: ea8880ceedfc04cda217ee17ba140475d003172c