Open
Description
react-native 0.63 is out, and one of the key changes is that RN has a new component/model for pressable type elements.
As I understand it, this API model is intended to replace all the Touchable*
family of APIs -- and indeed it appears to have several high level advantages that I see directly:
- It includes
onPressIn
/onPressOut
styling callbacks Add onPressIn and onPressOut to View #1135 -- this was a clunky issue that we had to implement when using RX in our app, so it'd be great to be able to delete that state-tracking code. - It includes more click callbacks including
onLongPress
References
Questions
- Are we interested in exposing new components in ReactXP?
- Are we interested in proactively migrating off of
Touchable
for the native-common interface? - Would we accept a poly/ponyfill-type implementation of this Component which implements all or a subset of this API so that we don't have to drop RN compatibility? -- Alternatively, would we support dropping RN compatibility?
Strategies
Prerequisite: Provide a Polyfill implementing some or all of Pressable or drop RN versions
A. Switch all use cases of Touchable
to Pressable
in native-common -- RX.Button
could be an alias / wrapper directly for RN.Pressable
?
B. Expose RX.Pressable
as a free standing component? -- Keep the rest of RX's native-common using Touchable
?
C. Suggestions?