-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Uncaught Error: Maximum update depth exceeded on tab change #2821
Uncaught Error: Maximum update depth exceeded on tab change #2821
Comments
Also: I can confirm that changing |
I have the same issue. Environment: I have made a minimal reproduction case: I have found the same issue from before: The issue from before had a solution with binding this.setState but I'm using functional component and useState. EDIT: I can confirm it is working as expected when using class component: EDIT 2: I have made a mistake in previous code example edit. I have not used the variable from component's state so page is undefined, it is just calling onChangeTab but it is not referencing state variable. If state variable is properly referenced the same is happening (maximum update depth): EDIT 3: I have found a hacky way to avoid this until this is fixed: |
I continue to have this problem even with this fix. It might be slightly different, but it seems like the onChangeEvent is firing more than one time with different page number values when the tab is switched, leading to an infinite loop. |
same here, |
Can you please provide us with a snack to reproduce. |
In my case I just removed the property |
Here is an example of this behavior: https://snack.expo.io/@hellsan631/native-base-tabs-example I should be able to control the state of tabs, so that they can respond to changes in the outside world. I would expect |
Please try out our latest release v2.12.5. This issue has been taken care of. Thank you for reporting! |
Hi, there |
I have gone through these following points
Issue Description
Changing tabs results in the following exception:
This happens before the function provided to
onChangeTab
is called.native-base 2.13.4
react 16.8.3
react-native 0.59.10
Expected behaviour
No crash.
Actual behaviour
Crash.
Steps to reproduce
Is the bug present in both iOS and Android or in any one of them?
Happens on both iOS and Android.
Any other additional info which would help us debug the issue quicker.
This appears to be similar to #2812 and #2810
The text was updated successfully, but these errors were encountered: