When swiping the tab view on both android and ios the application crashes. Setting swipeEnabled to false fixes the issue. Unfortunately our error reporting service isn't reporting stacktraces so we cannot provide one for this issue, but it seems reproduceable.
To be able to swipe between tabs!
<TabView
navigationState={this.state}
// eslint-disable-next-line new-cap
renderScene={SceneMap(sceneMap)}
onIndexChange={index => this.setState({ index })} // eslint-disable-line
renderTabBar={props => (
<View
style={{
backgroundColor: theme.color.impact.primary,
}}
>
{header}
<TabBar
{...props}
renderIcon={({ route }) => <SvgXml xml={iconType(route.key)} width="30" height="30" fill={iconColor(route.key)} />}
indicatorStyle={{ backgroundColor: theme.color.primary }}
style={{ backgroundColor: theme.color.textLight, borderBottomWidth: 1, borderColor: '#eee' }}
/>
</View>)
}
initialLayout={{ width: Dimensions.get('window').width }}
/>
Rendering a single tab fixes the issue. Setting swipeEnabled to false fixes the issue.
| software | version
| ---------------------------- | -------
| ios or android | 11
| react-native | 0.61.2
| react-native-tab-view | ^2.10.0
| react-native-gesture-handler | ^1.4.1
| react-native-reanimated | ^1.2.0
| node | 12.3.1
| npm or yarn | yarn 1.17.3
We are having the same issues on iOS but also touching anywhere in the tab view (not only swipe actions) causes the app to crash for Android. Can confirm that adding swipeEnabled set to _false_ fixes the issue.
Current Environment:
Android 8.1.0 | iOS 12.4 & 11.2.6
Tab view 2.9.0
RN 0.61.2
Node v10.15.3
yarn 1.12.3
After digging around for a bit I finally came across an error log when our app crashed with:
Unsupported top level event type \"onGestureHandlerStateChange\" dispatched
After doing a bit of googling came across this issue in react-native-gesture-handler that was quite informative/helpful.
Hi!! I had the same problem last some days ago.
After two days of desperate attempts I solved it in the same way of @EasiGregory .
But..........the day after, my teammate incredulous try to reset "swipeEnabled" to true.....and.......now all it works right!!!
It's a joke... 8-/
I think that the problem is an unalignment of bundle, but we are still investigating.
Hi our team had the same problem a few days ago, we solved it importing react-native-getsture-handler ^4.x as the first line in the index.js root
import 'react-native-gesture-handler'; <- first code line
looks like is a problem with the production bundle
Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.
.
Most helpful comment
Hi our team had the same problem a few days ago, we solved it importing react-native-getsture-handler ^4.x as the first line in the index.js root
import 'react-native-gesture-handler'; <- first code line
looks like is a problem with the production bundle