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

React Navigation Custom Tab Typescript Params

$
0
0

I am developing projects with Typescript language with React Native library. While creating a Custom Tab Bar, parameters include state, descriptors, and navigation. What should I specify as a type with this?

import { View, Text, TouchableOpacity } from 'react-native';function MyTabBar({ state, descriptors, navigation }) {  const focusedOptions = descriptors[state.routes[state.index].key].options;  if (focusedOptions.tabBarVisible === false) {    return null;  }  return (<View style={{ flexDirection: 'row' }}>      {state.routes.map((route, index) => {        const { options } = descriptors[route.key];        const label =          options.tabBarLabel !== undefined            ? options.tabBarLabel            : options.title !== undefined            ? options.title            : route.name;........

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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