question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RectButton onPress does not work

See original GitHub issue

Hi,

RectButton’s onPress doesn’t work. I’m using React Native 0.60.4 inside of a Styled Component:

export const Hour = styled(RectButton)`
  background: #fff;
  padding: 20px;
  flex: 1;
  opacity: ${props => (props.enabled ? 1 : 0.7)};
  align-items: center;
  margin: 0 10px 20px;
`

I’ve tried running jestify, a manual React Native link despite the recommendations, cleaning cache but nothing works. It decided not to work for NOTHING.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

36reactions
4ykicommented, Aug 8, 2019

Screen Shot 2019-08-08 at 12 35 48 PM Make sure you followed this insctructions

8reactions
fellypsantoscommented, Aug 17, 2022

UPDATE 2022-08-17

Documentation changed and the installation is now more easier the ever. Take a look at the docs:

https://docs.swmansion.com/react-native-gesture-handler/docs/next/installation/#js

Resume:

install the lib yarn add react-native-gesture-handler

After installation, wrap your entry point with <GestureHandlerRootView> or gestureHandlerRootHOC

export default function App() { return <GestureHandlerRootView style={{ flex: 1 }}>{/* content */}</GestureHandlerRootView>; }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gesture Handler discontinued? RectButton dont workig (but its ...
I tried using ReactButton, but the onPress function doesn't run on click. All posts found on google are about not writing an arrow...
Read more >
Buttons | React Native Gesture Handler - Software Mansion
This library allows to use native components with native feedback in adequate situations. If you do not wish to implement custom design approach,...
Read more >
RectButton onPress not work under Modal - Bountysource
RectButton onPress not work under react-native component Modal , but TouchableOpacity works. some dependency:
Read more >
How to use RectButton in react-native-gesture-handler - Tabnine
RectButton (Showing top 4 results out of 315) ... justifyContent: 'center', }}> <RectButton onPress={() => { console.warn('press (this wont be printed)');.
Read more >
Button - React Native
A basic button component that should render nicely on any platform. Supports a minimal level of customization. If this button doesn't look ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found