Current behavior
<TabView
navigationState={{ index, routes }}
renderScene={renderScene}
onIndexChange={setIndex}
initialLayout={{ width: layout.width }}
renderTabBar={props => (
<TabBar
{...props}
indicatorStyle={{ backgroundColor: '#2497F3', }}
tabStyle={{ width: layout.width / 3, }}
scrollEnabled={true}
style={{ backgroundColor: 'white' }}
renderLabel={({ route, focused, color }) => (
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
<Text style={{ ...Fonts.blackRegular, marginRight: 5.0 }}>
{route.title}
</Text>
<View style={{
width: 24.0, height: 24.0, borderRadius: 12.5, backgroundColor: Colors.primary,
alignItems: 'center', justifyContent: 'center'
}}>
{route.title == 'Active' ?
<Text style={{ ...Fonts.whiteRegular }}>{activeDataList.length}</Text> :
route.title == 'Past' ?
<Text style={{ ...Fonts.whiteRegular }}>{pastDataList.length}</Text> :
<Text style={{ ...Fonts.whiteRegular }}>{cancelledDataList.length}</Text>
}
</View>
</View>
)}
/>
)}
/>
Expected behavior
it should display tab view but it fails with error
Reproduction
https://github.com/hpardess/ClinicApp
Platform
Environment
package
version
react-native-tab-view
^3.1.1
react-native-pager-view
^5.4.9
react-native
0.66.4
node
16.13.0
npm
8.1.0
👍 React with 👍 6neilhem, crisprcoders, liucf, makhataibar, muskanjain16 and 1 more