satya164 / react-native-tab-view

A cross-platform Tab View component for React Native
MIT License
5.13k stars 1.07k forks source link

Allow children dictate height #1383

Closed daniel112 closed 2 years ago

daniel112 commented 2 years ago

Remake of this PR: https://github.com/satya164/react-native-tab-view/pull/1237

Please provide enough information so that others can review your pull request:

Motivation A follow-up to this comment: https://github.com/satya164/react-native-tab-view/pull/1198#issuecomment-889945740

There exists some use case where we want to embed this tab view within a view (typically a scroll view), doing so does not properly set the height UNLESS you specifically give TabView a static height. In some cases, our content needs to be dynamic so setting a specific height prior to rendering the content will not look great.

This PR covers the edge case where:

Test plan

Before changes

https://user-images.githubusercontent.com/3317835/127685333-27d745f6-3614-44b0-aa9b-dc0febd25d39.mp4

After changes

https://user-images.githubusercontent.com/3317835/127685318-afdb8c1f-f36f-4b3b-943a-e8841032271b.mp4

https://user-images.githubusercontent.com/3317835/124084979-67bb8900-da04-11eb-842b-98980a40a798.mp4

daniel112 commented 2 years ago

@okwasniewski I'm not able to get it working anymore after the dependencies upgrade. could be the react-native-pager-view upgrade or expo.

not 100% sure

okwasniewski commented 2 years ago

Hey @daniel112, sorry for misunderstanding I'm afraid this won't work with the current pager-view version. I'm closing this one for now.

gabrielfurini commented 2 years ago

@daniel112 It seems a recent update in the react-native-pager-view caused this. There is a mention here: https://github.com/satya164/react-native-tab-view/issues/1274#issuecomment-1228431179