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

React Navigation 6 change the size which is passed to tabBarIcon

$
0
0

In BottomTabNavigationOptions type, under field tabBarIcon there is a callback which can be defined by the user:

(props: { focused: boolean; color: string; size: number }) => {      return (<Image          source={icon}          style={{            width: props.size,            height: props.size,            resizeMode: "contain",            tintColor: props.color,          }}        />      );

I want to change the size of the icon, but if I ignore size in props then the elements do not fit within the tab bar. How can I tell react-navigation 6 to call this callback with a different size in the props, so that the bar expands to fit the larger icon?


Viewing all articles
Browse latest Browse all 6295

Trending Articles



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