ptomasroos / react-native-scrollable-tab-view

Tabbed navigation that you can swipe between, each tab can have its own ScrollView and maintain its own scroll position between swipes. Pleasantly animated. Customizable tab bar
https://www.npmjs.com/package/react-native-scrollable-tab-view
6.94k stars 2.29k forks source link

Error Switching between tabs #1137

Open HadiKhalifeh opened 3 years ago

HadiKhalifeh commented 3 years ago

<ScrollableTabView style={{ flex: 1 }} category={this.state.selectedCategory} showsHorizontalScrollIndicator={false} prerenderingSiblingsNumber={1} initialPage={0}

          onChangeTab={(res =>
           this.setState({ currentTab: res.i, showClearForFilters: false }))
          }

          renderTabBar={() => <ScrollableTabBar  />}

          >
          {tabs.map((item, index) => (

            <ProductList
              index={index}
              hideShowCategories={() => {
                if (!this.state.firstTimeClosed) {
                  this.setState({
                    firstTimeClosed: true,
                    showCategories: false,
                  });
                }
              }}
              tabs={tabs}

              showClearForFilters={this.state.showClearForFilters}
              item={item}
              sortByType={sortByType}
              groceryId={this.props.item.id}
              category={this.state.selectedCategory}
              navigation={this.props.navigation}
              tabLabel={item.name ? item.name : item.title}
            />
          ))}
        </ScrollableTabView>