I want to call the onPress() method of my Pressable. How can I achieve this? I tried calling the onPress() method when I hit the second button via a ref but it did not work.
const pressableRef = useRef(null);
return (
<Pressable
style={{ width: 100, height: 100, backgroundColor: 'yellow' }}
onPress={() => console.log('I want to print this')}
ref={pressableRef}
/>
<Button
title="Klick me"
onPress={() => {pressableRef.current.onPress()}
/>
);