Add reproducer to RN-Tester for #44610 (#45293)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45293

I'm justing adding a repro to RN-Tester to further investigate:
https://github.com/facebook/react-native/issues/44610

Changelog:
[Internal] [Changed] - Add reproducer to RN-Tester for #44610

Reviewed By: yungsters

Differential Revision: D59375787

fbshipit-source-id: 3bc4f45e3686109bf731008bc27e47c4eb314e48
This commit is contained in:
Nicola Corti
2024-07-05 01:53:08 -07:00
committed by Facebook GitHub Bot
parent 62cca7accc
commit d2edc71619
@@ -321,6 +321,9 @@ const styles = StyleSheet.create({
wrapperCustom: {
borderRadius: 8,
padding: 6,
width: '100%',
justifyContent: 'center',
alignItems: 'center',
},
hitSlopWrapper: {
backgroundColor: 'red',
@@ -390,6 +393,33 @@ const examples = [
);
},
},
{
title: 'Change child based on Press',
description:
('You should be able to press the button, move your finger while pressing, and release it with the proper status updates.': string),
render(): React.Node {
return (
<View style={styles.row}>
<Pressable
style={({pressed}) => [
{
backgroundColor: pressed ? 'rgb(210, 230, 255)' : 'white',
},
styles.wrapperCustom,
]}>
{({pressed}) => (
<>
{pressed && <Text style={styles.text}>Pressed!</Text>}
{!pressed && (
<Text style={styles.text}>Press me and move your finger</Text>
)}
</>
)}
</Pressable>
</View>
);
},
},
{
title: 'Pressable feedback events',
description: ('<Pressable> components accept onPress, onPressIn, ' +