Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Allow children dictate height #1383

Closed

Conversation

daniel112
Copy link

Remake of this PR: #1237

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

Motivation
A follow-up to this comment: #1198 (comment)

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:

  • you want to embed a tabview that's not full screen and/or is within another view
  • your content is dynamic is height

Test plan

  • I've added an example to the /example folder to better visualize this, but I also have been using this modified version in my production application

Before changes

before.mp4

After changes

after.mp4
dynamic.mp4

@daniel112
Copy link
Author

@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
Copy link
Collaborator

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
Copy link

gabrielfurini commented Oct 2, 2022

@daniel112 It seems a recent update in the react-native-pager-view caused this. There is a mention here: #1274 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants