Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

Can't add multiple childen in react

$
0
0

When I try to add icons inside bottom tab https://icons.expo.fyi/it shows Tab.Navigator error

This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided.ts(2746)

i try add

children: React.ReactNode;

but got ReactNode error

Property 'ReactNode' does not exist on type 'typeof React'.ts(2339)

Here is index.tsx file

 const Tab = createBottomTabNavigator(); function BottomTabNavigator() {   return (<Tab.Navigator><Tab.Screen name="Dashboard" component={DashboardScreen} />       screenOptions={({ route }) => ({          tabBarIcon: ({ focused, color, size }) => {            let iconName;            if (route.name === 'Dashboard') {              iconName = focused                ? 'ios-speedometer'                : 'ios-speedometers';            } else if (route.name === 'Settings') {              iconName = focused ? 'ios-list' : 'ios-list-outline';            }<Tab.Screen name="Settings" component={TabTwoScreen} /></Tab.Navigator>   ); }

https://reactnavigation.org/docs/tab-based-navigation/

https://reactnavigation.org/docs/bottom-tab-navigator/


Viewing all articles
Browse latest Browse all 6290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>