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

Slow Transition when swiper on android. pls help me :'(

Open minhphung210 opened this issue 8 years ago • 11 comments

I have a tabStack that uses reactive navigation. It is structured as follows:

const AccountTab = createStackNavigator(
  {
    Account: { screen: Account },
    UserManager: { screen: UserManager },
    History: { screen: History },
    HistoryDetail: { screen: HistoryDetail },
    Point: { screen: Point }
  },
  {
    initialRouteName: "Account",
    headerMode: "none"
  }
);
const TabNav = createBottomTabNavigator(
  {
    ProductTab: {
      screen: ProductTab,
      navigationOptions: {
        title: "Sản Phẩm",
        tabBarIcon: ({ tintColor }) => (
          <Image
            resizeMode="contain"
            source={Images.productIcon}
            style={[styles.icon, { tintColor: tintColor }]}
          />
        )
      }
    },
    SaleTab: {
      screen: SaleTab,
      navigationOptions: {
        title: "Khuyến mãi",
        tabBarIcon: ({ tintColor }) => (
          <Image
            resizeMode="contain"
            source={Images.gitfIcon}
            style={[styles.icon, { tintColor: tintColor }]}
          />
        )
      }
    },
    HomeTab: {
      screen: HomeTab,
      navigationOptions: {
        title: "Home",
        tabBarIcon: ({ tintColor }) => (
          <Image
            resizeMode="contain"
            source={Images.homeIcon}
            style={[styles.icon, { tintColor: tintColor }]}
          />
        )
      }
    },
    TransferTab: {
      screen: TransferTab,
      navigationOptions: {
        title: "Nhượng quyền",
        tabBarIcon: ({ tintColor }) => (
          <Image
            resizeMode="contain"
            source={Images.transferIcon}
            style={[styles.icon, { tintColor: tintColor }]}
          />
        )
      }
    },
    AccountTab: {
      screen: AccountTab,
      navigationOptions: {
        title: "Tài khoản",
        tabBarIcon: ({ tintColor }) => (
          <Image
            resizeMode="contain"
            source={Images.accountIcon}
            style={[styles.icon, { tintColor: tintColor }]}
          />
        )
      }
    }
  },
  {
    initialRouteName: "HomeTab",
    tabBarOptions: {
      activeTintColor: Colors.leetee,
      inactiveTintColor: Colors.charcoal,
      swipeEnabled: true
    }
  }
);

When I navigate to the "Point" screen containing the ScrollableTabView inside AccountTab , it works very well. But if I switch to another tab and navigate inside these tabs. Then go back to AccountTab and watch the delay. If I unmount the screen, then back it is fine.

here is my video demo : https://www.youtube.com/watch?v=W2oOQu-Ri5k&feature=youtu.be

and here is my code :

screen shot 2018-07-11 at 10 51 10 am

update : when i delete the === Platform case 'android' and lumped it with the same instances with IOS in the index.js inside the node_module / native-scrollable-tab-view. it works perfectly I think the problem is due to ViewPagerAndroid.

Who has a better resolution?

sorry about my english :))

minhphung210 avatar Jul 11 '18 03:07 minhphung210

i get same issue.

hungdev avatar Jul 16 '18 13:07 hungdev

@minhphung210 I know the reason. in my case, the reason is the old react native version. My react native version is 0.54.2. After update to 0.56.0, it runs fine. You can try update to newest react native version.

hungdev avatar Jul 16 '18 15:07 hungdev

thank for reply. I will try

minhphung210 avatar Jul 17 '18 01:07 minhphung210

Any luck with the update @minhphung210 ?

phil-hodgson-1st avatar Jul 30 '18 01:07 phil-hodgson-1st

@phil-hodgson-1st I encountered a bit of error when updating version 0.56 of react-native so I decided to keep the version and fix it in the way of the above mentioned

minhphung210 avatar Jul 30 '18 02:07 minhphung210

@minhphung210 Which version are you using?

renandelmonico avatar Aug 24 '18 20:08 renandelmonico

Having same same issue. Using react native "react-native": "0.57.0" . Anyone got solution?

koo1006 avatar Sep 26 '18 03:09 koo1006

@ptomasroos why do you close this issue?

hungdev avatar Oct 25 '18 09:10 hungdev

Would be great if we could open a new issue with a repository so this is reproducable. If someone wants us to help out with this please at least provide a repository which is runnable, will make the life easier for everyone!

ptomasroos avatar Oct 25 '18 10:10 ptomasroos

solution to the do?

ibubbo avatar Nov 19 '19 07:11 ibubbo

@ptomasroos After setting this property (prerenderingSiblingsNumber={Infinity}), you can see the delay

ibubbo avatar Nov 19 '19 07:11 ibubbo