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

Lag between tap and the tab changing #47

Closed
Flavien opened this issue Oct 3, 2017 · 9 comments
Closed

Lag between tap and the tab changing #47

Flavien opened this issue Oct 3, 2017 · 9 comments

Comments

@Flavien
Copy link

Flavien commented Oct 3, 2017

I'm using react-native-material-bottom-navigation with react-navigation and Redux.

When tapping a tab, there is a half a second delay between tapping and the navigation actually happening. I can see the ripple effect on the tab is also delayed.

Any idea why it's doing that?

@timomeh
Copy link
Owner

timomeh commented Oct 4, 2017 via email

@buckydroid
Copy link

I'm also facing the same problem. Tab change is not that smooth..

@timomeh
Copy link
Owner

timomeh commented Oct 13, 2017

I need more informations on this. /cc @buckydroid @Flavien

Mostly I need to know if the delay is gone when you switch to react-navigations TabBar. Cause there is a similar issue in react-navigation: react-navigation/react-navigation#2631

@wildseansy
Copy link
Contributor

wildseansy commented Oct 30, 2017

Related: I have also noticed that if you click a bunch of tabs fast (easiest to reproduce with two thumbs on a real device), tab switch keeps repeating forever, and device becomes non-responsive.

@timomeh
Copy link
Owner

timomeh commented Oct 31, 2017

@wildseansy I don't think the behaviour you described is related to this particular issue. It seems like it's an issue in react-navigation, but there's neither a response in their issue nor a response here.

@Flavien
Copy link
Author

Flavien commented Oct 31, 2017

The same seem to happen even without react-navigation integration.

@timomeh
Copy link
Owner

timomeh commented Nov 2, 2017

I tested the BottomNavigation without the react-navigation integration, using this Snack: https://snack.expo.io/SJU96kK0Z

I can't see a delay, at least on my device. The screen updates immediately.

@Tocher
Copy link

Tocher commented Dec 10, 2017

i'm also see some lag on iphone 6.
but on iphone 6s no.

I disable PressRipple Animation and RippleBackground Animation and now all good.
dont know is this useful information

@timomeh
Copy link
Owner

timomeh commented Feb 23, 2018

I once again tested this and can't see any delay. (Tested it with and without react-navigation, on two android phones, Android emulator and iOS simulator. I used the code from the examples.)

My assumption is that such delays are caused by the performance of the app, not the BottomNavigation itself. If you do a lot of stuff in your Screens, maybe together with redux, you could have many unnecessary re-renders.

After digging around a bit and reading the same issues in react-navigation's Issues, I stumbled across react-navigation/react-navigation#608 (comment) and react-navigation/react-navigation#608 (comment). The advices in those comments are really good to improve the performance of your app, even if you aren't using react-navigation.

If you notice a delay with a very simple App, please comment below with more details (OS, Device, Software-Version, RN-Version, Code, etc).

@timomeh timomeh closed this as completed Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants