import React from 'react'; import cls from 'classnames'; import View from '../../View'; import { ITabViewProps } from './Tabview.PropType'; import FooterBar from '../../Bar/FooterBar'; class TabView extends React.Component { state = { current: 0, }; onTabChange = (index: number, name?: string) => { this.setState({ current: name || index, }); }; render() { const { onTabChange } = this; const { current } = this.state; const { color, selectedColor, style, tabbarStyle, list } = this.props; return ( {list?.map((item, index) => { const isSelect = typeof current === 'string' ? current === item.name : current === index; return ( {item.view} ); })} ); } } export default TabView;