-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab Screen is showing up blank #88
Comments
Interesting, by removing onIndexChange this worked. Any idea why? |
@danielfein try wrapping the container into useMemo, see the onIndexChange example of the examples folder and let me know. Also your setIndex won't work because it receives an object, not the current index, see the readme. |
I can confirm this as well. Going to try to find a solution as part of #93 |
@PedroBern the problem is related to this:
react-native-collapsible-tab-view/src/createCollapsibleTabs.tsx Lines 203 to 205 in fe4ac3c
Which makes the This bug can manifest for other reasons as well, I've been tracking it in a different situation so this seems to explain it. As mentioned previously, I'll fix it as part of #93 |
@PedroBern This part is also problematic: react-native-collapsible-tab-view/src/createCollapsibleTabs.tsx Lines 240 to 243 in fe4ac3c
It takes control of the scroll mid-way and auto-snaps the page, I could attach a video but it should be easy to reproduce. Removing it entirely doesn't seem to cause any issues that I can see. What was the purpose of it? |
@andreialecu has only one purpose: fix the screen/page position when switching the device orientation (when the Below is an ilustration of the issue. Forcing the container to jump to the correct index was the quickest solution. I'm sure we can solve this with a different approach. Also, I'm sure adding
|
@andreialecu Demo from above: |
Version 4.0 with api refactoring and dynamic tabs. BREAKING CHANGES: createCollapsibleTabs() no longer exists. Instead the library exports different components (Container, Tab, ScrollView, ListView) which can be nested like normal react components. refMap no longer exists, and creating refs is no longer necessary (it's all handled internally) ScrollView/FlatList now forward their refs, so the caller can just tap into their ref prop the existing onIndexChange was renamed to onTabChange, and a separate onIndexChange was implemented that just returns the new index (as a number) diffClampEnabled was changed to revealHeaderOnScroll redundant prop snapEnabled was removed, instead snapThreshold is number | null | undefined. If not a number, then snap is not enabled. Setting it to 0.5 will result in snapping in the middle, like in the previous version. Fixes: #100, #98, #94, #88
Facing same issue after updating |
Current behavior
Currently I have 4 screens and set them each to have a width of the window. Despite this, when swiping from one to the other the next screen is visible but then when you get to the point of the index changing, it disappears. If you click to another tab the same thing happens, it's just blank.
Expected behaviour
I would expect to see the relevant screen on both swipe and when each tab is selected.
Code sample
Screenshots (if applicable)
buggy.mov
What have you tried
I originally had the 4
<Tabs.ScrollView />
components as the ones that are actually use in my app. I've minimized down to the bare elements to try and see where I may be causing my error but even with this basic layout it isn't working.I've tried alternative widths and flex: 1, etc. I can't figure out where the issue is.
The text was updated successfully, but these errors were encountered: