Skip to content
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

onChangeTab results in undefined error #1193

Open
2 tasks done
mmckinley8 opened this issue Mar 9, 2023 · 1 comment
Open
2 tasks done

onChangeTab results in undefined error #1193

mmckinley8 opened this issue Mar 9, 2023 · 1 comment

Comments

@mmckinley8
Copy link

mmckinley8 commented Mar 9, 2023

  • onChangeTab never fires, results in error: TypeError: undefined is not a function, js engine: hermes

Steps to Reproduce

Change a tab

Expected Behavior

Tab should change

Actual Behavior

Nothing happens, results in error. CHANGING TAB never prints out. Just get the undefined error.

      <ScrollableTabView
        initialPage={0}
        locked={false}
        onChangeTab={({ i, from }) => {
          console.log('CHANGING TAB', i, from)
          return i !== from && setSelectedTab(i)
        }}
        renderTabBar={() => <ScrollableTabBar inactiveTextColor="#425164" />}
        scrollWithoutAnimation={false}
        style={{ backgroundColor: 'white' }}
        tabBarActiveTextColor="#3D7BCC"
        tabBarBackgroundColor="white"
        tabBarInActiveTextColor="#425164"
        tabBarTextStyle={{ fontFamily: 'Calibre-Medium', fontWeight: '500', fontSize: 17 }}
        tabBarUnderlineStyle={{ backgroundColor: '#3D7BCC' }}
      >
        {topics.map((item, index) => {
          return <View isSelected={selectedTab === index} key={item.id} tabLabel={item.label} />
        })}
      </ScrollableTabView>
@shukerullah
Copy link

The issue has been fixed, but it hasn't been updated on npm yet. Temporary fix:
yarn add https://github.com/ptomasroos/react-native-scrollable-tab-view

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

No branches or pull requests

2 participants