Skip to content

Commit 0e49722

Browse files
authored
Wrap Pressable with forwardRef (#3431)
## Description This PR wraps `Pressable` component with `forwardRef` such that `NativeButton` can be accessible via `ref`. Fixes #3427 ## Test plan <details> <summary>Tested on the following code:</summary> ```jsx import React, { useEffect } from 'react'; import { StyleSheet, View } from 'react-native'; import { Pressable } from 'react-native-gesture-handler'; export default function EmptyExample() { const pressableRef = React.useRef(null); useEffect(() => { console.log(pressableRef); }, []); return ( <View style={styles.container}> <Pressable ref={pressableRef} onPress={() => console.log('click')} style={{ width: 100, height: 100, backgroundColor: 'crimson' }} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, }); ``` </details>
1 parent 3b29b4e commit 0e49722

File tree

1 file changed

+386
-359
lines changed

1 file changed

+386
-359
lines changed

0 commit comments

Comments
 (0)