Skip to content

Instantly share code, notes, and snippets.

@gigobyte
Last active July 11, 2025 09:43
Show Gist options
  • Select an option

  • Save gigobyte/70903354799073ba0f9f657d0ffc3f48 to your computer and use it in GitHub Desktop.

Select an option

Save gigobyte/70903354799073ba0f9f657d0ffc3f48 to your computer and use it in GitHub Desktop.
function Test() {
const [shown, setShown] = useState(true)
if (!shown) {
return (
<Pressable
key="1"
testID="other-pressable"
style={{ width: 30, height: 30, backgroundColor: 'red' }}
onPress={() => console.log('pressed')}
/>
)
}
return (
<Pressable key="2" testID="bad-pressable" onPress={() => {}}>
<TextInput
style={{ backgroundColor: 'green', width: 100, height: 30 }}
onSubmitEditing={() => setShown(false)}
/>
</Pressable>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment