Questions tagged [pressable]

For questions related to React-Native's Pressable component

32 questions
0
votes
1 answer

Pressables in react-native app wont't work

I have two very simple components and the pressables I have in my Start component just won't work, not the navigation or the console.log(), I can't even inspect them with the element inspector... I am using ImageBackground of react native for the…
0
votes
2 answers

ReactNative Pressable align text to center

I'd like align text to center in a Pressable element, but doesn't work for me. import React from 'react'; import { StyleSheet, Pressable, GestureResponderEvent, PressableProps, Text } from 'react-native'; interface MyButtonProps extends…
Papp Zoltán
  • 131
  • 7
0
votes
0 answers

React Native Pressable OnPress Function

Currently I am working on a React Native Project where I have to connect to an API. I am creating a search function but it seems like the Pressable function is not working. Here is the Search function I am working at. I have add a few console.log to…
0
votes
1 answer

Passing a button select choice back to previous screen

So after some research, I have learned how to make a button that will take the user to another screen, and provide them a text input where they can enter some words, then on pushing the done button take them back to the previous screen where what…
0
votes
1 answer

React Native fire onLongPress type event but for dragging motion

I am building a game with React Native. In order to make a move in one of the four cardinal directions, the player must swipe anywhere on the screen. Up until now, I have achieved this with the following code, which records the XY position where the…
Stefan Todoran
  • 93
  • 1
  • 10
0
votes
0 answers

How can I make a button stay highlighted when pressing on it in React Native?

How can you make a button stay highlighted after you selected it? I've already used and searched the other touchables and I can't seem to find any props that allows that feature.
randelski
  • 1
  • 2
0
votes
1 answer

React Native - onPress not changing radio button style

When i click my Pressable RadioButton i want it to change the button style from styles.radio to styles.checked. so that it fills the empty circle. How can i implement this so that it happens when user is pressing my RadioButton? Right not nothing…
Kikoanno
  • 91
  • 2
  • 10
0
votes
1 answer

React Native need to appear next to the pressable checkbox not inside

I need that the Text appears next to the pressable checkbox not inside it... How can i do this using styles and not changing the code structure? return (
Kikoanno
  • 91
  • 2
  • 10
0
votes
1 answer

How to pass prop with the Pressable onPress attribute or with any other attribute or any alternative method?

I am trying to pass the answer string (of mapped answers) into handleButtonClick function where I will compare the answer with the correct answer. Here is the code that is creating the answer string: {answers.map(answer => ( …
Anthon Santhez
  • 402
  • 1
  • 7
  • 13
0
votes
1 answer

How to get React Native Pressable onPress to manipulate target

I have an array filled with the letters of the alphabet that I have turned into Pressable components. My goal is to change the color of the letter clicked depending on some state. React Native's Pressable onPress prop accepts a function with an…
0
votes
1 answer

Why does my pressable component display my off image on first tap and then works as expected?

I aim to present a button that shows an on state image on press and when left immediately shows an off state image. On first tap the button displays the off state image and on all following taps it shows the on state image on tap as expected. Why…
Alex
  • 57
  • 7
0
votes
1 answer

React Native - Continuous textinput delete on Pressable longpress

I have this little concern wherein when I tried to do a onLongPress with Pressable. the function associated to that are only called once. How can I have it continuously delete the value on textInput when I hold the pressable? Sample…
0
votes
0 answers

Differences between Pressable and TouchableWithoutFeedback

Pressable and TouchableWithoutFeedback are higher order components to add touch functionality to their children. They have very similar use cases. I guess I can use Pressable anywhere in place of TouchableWithoutFeedback(due official docs…
0
votes
1 answer

In React Native, is there anything similar to the activeOpacity prop in the new Pressable component?

In TouchableOpacity, it is possible to set the value of the activeOpacity prop to dim the button after it was pressed, so the user had feedback that their touch was registered and does not pressing the same button repeatedly. Is there anything…
ahron
  • 803
  • 6
  • 29
0
votes
2 answers

Delay style display when using Pressable React Native component

I'm using the Pressable React Native component for items displayed in a FlatList. I want to be able to scroll back and forth through the list and have no feedback from the items, unless pressed for a a little while. The onPress function invoked can…
feiti
  • 87
  • 3
  • 12