score:4
you can use touchableopacity
as a view
that provides touchable feedback. eg
<touchableopacity
onpress = {() => function()}
onlongpress = {() => longerfunction()}
style = {{these can be the same as a normal view}}>
</touchableopacity>
you can also use touchablehighlight
and touchablewithoutfeedback
, which provide a darkening onpress effect and no effect respectively.
Source: stackoverflow.com
Related Query
- How to listen to a touch event in React Native?
- How can I propagate touch event in nested Touchable in React Native?
- How do I listen to keyboard input in React Native
- How to get React to listen for a click event called in Jquery
- How to make React listen to event in Child component first instead of Parent component?
- How to listen to bootstrap modal close event in react
- How to detect hold and fastforward event in react native TVEventHandler
- How can I prevent event bubbling in nested React components on click?
- How to use onClick event on react Link component?
- How to detect when a React Native app is closed (not suspended)?
- How do I exit/shut down a React Native app?
- How do you make the ListHeaderComponent of a React Native FlatList sticky?
- React - how to capture only parent's onClick event and not children
- How to concatenate JSX components in React Native
- How to add sourcemap in React Native for Production?
- How to test React Native Module?
- How to implement radio button in React Native
- How to adjust font size to fit view in React Native for Android?
- How to change background color of react native button
- React Native - how to use local SVG file (and color it)
- How to Position a React Native Button at the bottom of my screen to work on multiple ios devices
- react native how to call multiple functions when onPress is clicked
- How to add scroll event in react component
- How to dim a background in react native modal?
- How to create two columns with space beetwen in react native - flatList
- How to keep scroll position using flatlist when navigating back in react native ?
- How can I add onKeyPress event to react material-ui textfield?
- How can I present a native UIViewController in React Native? (Can't use just a UIView)
- How to close the modal in react native
- React Native - How to open route from push notification
More Query from same tag
- React redux, array state not updating
- console.log showing data but getting error in if condition javascript (using inside react component)
- Wait for API data before render react hooks
- How can I set the data on this component when inside a parent component?
- How to have Nginx to proxy pass only on "/" location and serve index.html on the rest
- How to center Dialog title in MUI?
- You should not use <withRouter(TransitionSwitch) /> outside a <Router>
- Need to show page header and an image side by side
- API Calls based on Condition
- Minified react error #301 | Infinity-Loop | Re_rendering
- Force react-router app to send URL requests to server
- cannot GET after refresh, and error in creating a catch all for server - Express and React
- Does BrowserRouter use more data/bandwidth than HashRouter?
- On iOS React text/number input is stuck forcing user to enter in phone number
- React: Module not found: Can't resolve 'react-router-dom' in '/usr/src/app/src'
- Timeout on Axios Requests
- Inserting a Custom Script in React Helmet/ Gatsby
- Adding an object to an array contained inside an object without overriding
- Trying to debounce search function calls results in no event passed to a function
- ApexCharts barchart vertical categories logic in ReactJs?
- Why is requestAnimation frame called multiple times for some frames, and not at all for others?
- How to access outside the JS FETCH API the returned value
- Preview multiple drop using react-dropzone
- How to delete part of a nested collection in Firebase?
- Call setState with Click or Escape Key
- React Hooks - How to use a make a state dependant on another state?
- React hooks get previous state of state A when setting state of state B
- How to pass props with React/Typescript?
- How to make a Semantic UI React grid full screen with different row heights?
- I am using react-router-dom for my react.js project and it adds /#/ in the route URL. Can I get rid of it? if yes, how?