import React from 'react'; import { View, TouchableOpacity, Text } from 'react-native'; import styles from './styles'; import { themes } from '../../constants/colors'; interface ITabBarProps { goToPage({}): void; activeTab: number, tabs: [], tabEmojiStyle: object, theme: string } export default class TabBar extends React.Component> { shouldComponentUpdate(nextProps: any) { const { activeTab, theme } = this.props; if (nextProps.activeTab !== activeTab) { return true; } if (nextProps.theme !== theme) { return true; } return false; } render() { const { tabs, goToPage, tabEmojiStyle, activeTab, theme } = this.props; return ( {tabs!.map((tab, i) => ( goToPage!(i)} style={styles.tab} testID={`reaction-picker-${ tab }`} > {tab} {activeTab === i ? : } ))} ); } }