import React, { Component } from "react" import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; import Icon from '../item/icon' interface State { } interface Prop { tabs: any activeTab: any goToPage: Function pageThat:any styleActiveText: any styleActiveIcon: any styleNormalIcon: any styleNormalText: any styleBaseBox:any } export default class extends Component{ tabIcons = [] constructor(props: Prop) { super(props); } render() { return {this.props.tabs.map((tab, i) => { return { this.props.goToPage(i)}} > { this.tabIcons[i] = icon; }} /> {tab.tabTitle} ; })} ; } } const styles = StyleSheet.create({ touch: { flex: 1, }, item: { flex: 1, alignItems: 'center', justifyContent: 'center', }, });