For questions related to React-Native's Pressable component
Questions tagged [pressable]
32 questions
3
votes
2 answers
How is HitRect used with Pressable in React Native?
We're planning on switching from TouchableOpacity to Pressable.
We want to use Pressable's optional HitRec to ensure our hit targets are appropriately sized (we'll calculate the dimensions) for accessibility purposes.
The Pressable documentation has…

David Nedrow
- 1,098
- 1
- 9
- 26
2
votes
2 answers
How to deploy Pressable effect excluding child component?
I have parent B and child A.
I want to make it, if I click B, it navigates to previous screen. (navigation.goBack())
So I make B and A as:
navigation.goBack()}>
A
But…

Hyejung
- 902
- 1
- 8
- 22
2
votes
1 answer
Custom TouchableOpacity from Pressable TypeScript error
Have this custom TouchableOpacity function component, but for the style prop I'm getting a TS error
import { StyleSheet, Pressable, PressableProps, GestureResponderEvent } from 'react-native';
export default function TouchableOpacity(props:…

razor7
- 2,165
- 2
- 19
- 32
2
votes
1 answer
React Native Pressable onPressIn only called when OnPress handler is present
In the android emulator, the following RN code does nothing (no log, no handler called)
{console.log("onPress");this.props.touchHandler()}}>
However, if I insert a onPress handler,…

Ken
- 4,367
- 4
- 28
- 41
2
votes
0 answers
getting the position of items inside React Native FlatList
Scenario:
I've got a number of items inside FlatList and I'm showing a Modal, with item coordinates, on long-pressing any of the Items and closing it when the touch is released.
I'm using Pressable for achieving long-press and onLayout to get the…

Naresh
- 941
- 9
- 22
1
vote
0 answers
onPressIn, onPressOut, onLongPress of Pressable not triggered on web for shared module
I have a monorepo using yarn workspaces with a react native app and a library with components. When I import my custom Button component from the library to my app the onLongPress, onPressIn and onPressOut are not triggered on the web using react…

Max Black
- 21
- 3
1
vote
0 answers
React Native "Pressable" Elements sometimes don't respond
I have a BigList element that renders group of Pressable elements. Elements work perfectly most of the time but sometimes they don't respond. It just doesn't press. BigList Element:
{
…

Eren Talan
- 51
- 3
1
vote
1 answer
React Native how to make an action when a user first puts their finger on a screen and then (without lifting it) goes over a pressable which activates
I am building a React Native app and I am trying to make it so that when a user can slide their finger from a place not on the pressable to the pressable without lifting their finger and when the finger is over the pressable an action happens. How…

Itay Lador
- 313
- 1
- 10
1
vote
1 answer
How to change text color when Pressable pressed
I have a Pressable with a Text inside and i want to change the color of the text when the pressable is pressed (it is ok for Pressable's backgourndcolor but not for Text)
I tried something like :

l4rnaud
- 179
- 9
1
vote
1 answer
Pressable not working inside nested View -- React native
I am using a pressable below an image in a nested view having a background color inside of a parent container view however, onPress is not responding unless I position the pressable absolute (which is forcing me to reposition other components) or…

Rizwan
- 71
- 8
1
vote
0 answers
Pressable not touchable in React Native app
I have some Pressable elements that appear on my iPhone in Expo, but are not touchable at all. I cannot even click them in the element inspector. Can anyone guide me towards a solution? I wonder if it's the nesting and it's parent container…

PhilosophOtter
- 183
- 1
- 2
- 12
1
vote
0 answers
React-Native Pressable component randomly stops working
I am having a strange issue where a pressable component with a hit slop of 'top: 20, bottom: 20, left: 50, right: 50' randomly stops working.
I am currently using Expo 39.0.0 and React-Native 39.0.4.
Has anyone encountered any similar issues?

jmckie
- 241
- 4
- 11
1
vote
0 answers
React Native Pressables - Creating a native look button
If you create a React Native

Rap
- 6,851
- 3
- 50
- 88
0
votes
1 answer
Change Style on Pressable Click React Native
I am trying to create a custom button using pressable in react native but I cant change the style on press. Whenever I press on the pressable and change the style properties they reflect the change when I print it in the console but it isn't…

Aarya Chamkeri
- 47
- 5
0
votes
0 answers
Pressable with custom icon onPress not working
I'm a React Native newbie and I'm trying to assess the viability of porting to Android a React Native app that was originally written (not by me...) with iOS in mind.
At the moment I'm not trying to have code that will easily generate both Android…

mj4318
- 31
- 3