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.

[TabView] iOS TabView issue

See original GitHub issue

Is 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. image

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
abhinav-officialcommented, Sep 13, 2022

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 54

in node_modules/@rneui/base/dist/Tab/Tab.js

2reactions
tlmadercommented, Sep 9, 2022

Experiencing the same issue in 4.0.0-rc.3. Intermittent on iOS and never has happened on Android.

Read more comments on GitHub >

github_iconTop 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 >

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