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.

TouchableHighlight breaks ref property on his children

See original GitHub issue

TouchableHighlight breaks his children ref property:

<TouchableHighlight>
    <View ref={()=>{ console.log(`This will not be called.`); }}
</TouchableHighlight>

However, TouchableWithoutFeedback works fine:

<TouchableWithoutFeedback>
    <View ref={()=>{ console.log(`But this will!`); }}
</TouchableWithoutFeedback>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
hramoscommented, May 25, 2017

Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.

3reactions
hey99xxcommented, May 25, 2017

@hramos I don’t understand what’s the point of closing a valid bug report. It’s still an unfixed and fairly annoying bug, and closing it will make sure people don’t see it if anyone decide to contribute to react-native

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native TouchableHighlight : get component and context
The ref prop takes a callback for that very reason. You can use the callback to assign your child components to an object...
Read more >
TouchableHighlight - React Native
The underlay comes from wrapping the child in a new View, which can affect layout, and sometimes cause unwanted visual artifacts if not...
Read more >
The beginners guide to React Native and Firebase
This means that if a child property is different from the last state, it will be re-rendered with the new value. This is...
Read more >
4. Components for Mobile - Learning React Native, 2nd ...
In doing so, we touched upon the basics of building interfaces with React ... we apply images via CSS, such as when we...
Read more >
react-native-swipe-list-view-fix - npm
If your row is touchable (TouchableOpacity, TouchableHighlight, etc.) with an onPress function make sure renderItem returns the Touchable as the ...
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