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.

[RN 0.36.0] onLayout is returning 0 for view drawn in NavigationCardStack

See original GitHub issue

0a9b6be (I’m guessing) has caused onLayout to return 0 for views returned in renderScene in a NavigationCardStack.

return (
  <View onLayout={e => console.log(e.nativeEvent.layout.height)}>
    <View style={{height: 100}} />
  </View>
)

This prints 0. In 0.35.0 it prints 100. Using onLayout inside NavigationCardStack is important for iOS style dynamically resizing settings popovers.

What’s happening here?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
darkamenosacommented, Nov 7, 2016

Fixed!!! I wrapped the ScrollView by a View tag. Adding style={{flex: 1}} to the View tag solved the problem. 😄 😄

0reactions
ericvicenticommented, Nov 14, 2016

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - onLayout is not triggered - Stack Overflow
I have a small problem with triggering rotation event in react-native. I receive the error that this.setState is undefined . When I use...
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