[TabView] iOS TabView issue
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Explain what you did
I’ve tried impementing the example tabview on react native non expo and i get the following error.
Code:
import React from 'react';
import {Tab, Text, TabView} from '@rneui/themed';
import {View} from 'react-native';
export default () => {
const [index, setIndex] = React.useState(0);
return (
<View>
<Tab
value={index}
onChange={e => setIndex(e)}
indicatorStyle={{
backgroundColor: 'white',
height: 3,
}}
variant="primary">
<Tab.Item title="Recent" titleStyle={{fontSize: 12}} />
<Tab.Item title="favorite" titleStyle={{fontSize: 12}} />
<Tab.Item title="cart" titleStyle={{fontSize: 12}} />
</Tab>
<TabView value={index} onChange={setIndex} animationType="spring">
<TabView.Item style={{backgroundColor: 'red', width: '100%'}}>
<Text h1>Recent</Text>
</TabView.Item>
<TabView.Item style={{backgroundColor: 'blue', width: '100%'}}>
<Text h1>Favorite</Text>
</TabView.Item>
<TabView.Item style={{backgroundColor: 'green', width: '100%'}}>
<Text h1>Cart</Text>
</TabView.Item>
</TabView>
</View>
);
};
Expected behavior
Instead of rendering tabs, i get the error mentioned above in the screenshot.
Describe the bug
The issue is intermitent on iOS, sometimes when i open the screen with a Tabs component i get the error. On Android it doesn’t happen.
Steps To Reproduce
1. Create app with npx react-native init AwesomeProject
2.Copy example code
3.Run app on iOS and refresh a few times
4.Error appears
----versions----
"@rneui/base": "^4.0.0-rc.6",
"@rneui/themed": "^4.0.0-rc.6",
"react": "18.0.0",
"react-native": "0.69.4",
Screenshots
No response
Your Environment
`npx @rneui/envinfo`
```
Output from `npx @rneui/envinfo` goes here.
```
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
TabView disappearing on Xcode 13 | Apple Developer Forums
I am trying to add a Tab View to my app. On Xcode 13 it disappears when I navigate to a tab that...
Read more >SwiftUI Tabview Fix - Stack Overflow
The problem is, whenever I navigate away from the list page, the translucent tab bar stays. I don't want it to.
Read more >Working Around the Shortfalls of SwiftUI's TabView
When you have six or more tab bar items, TabView automatically replaces the fifth tab with a More tab and displays the rest...
Read more >SOLVED: Problems with TabView – SwiftUI - Hacking with Swift
I also noticed this same issue. I even took out the TabView and am controlling how the navigation works withint he app from...
Read more >react-native-tab-view - npm
The package exports a TabView component which is the one you'd use to render the tab view, and a TabBar component which is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
found a fix, guys. @d0rkish @sgtpsibin @mrslimslim @tlmader @radughitescu
All you need to do is add
if (inputRange.length-1!==outputRange.length)return 0;
after line 53 and before line 54in
node_modules/@rneui/base/dist/Tab/Tab.js
Experiencing the same issue in
4.0.0-rc.3
. Intermittent on iOS and never has happened on Android.