react-native-scrollable-tab-view icon indicating copy to clipboard operation
react-native-scrollable-tab-view copied to clipboard

onChangeTab results in undefined error

Open mmckinley8 opened this issue 2 years ago • 1 comments
trafficstars

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

mmckinley8 avatar Mar 09 '23 19:03 mmckinley8

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

shukerullah avatar Mar 17 '23 12:03 shukerullah