iRoachie / react-native-material-tabs

Material Design implementation of Tabs
MIT License
121 stars 56 forks source link

Added support for custom contents in tabs #35

Closed max-konin closed 5 years ago

max-konin commented 6 years ago

Hi

I've added support for custom contents (like Icons, view) inside tabs.

Use case:

import Ionicons from 'react-native-vector-icons/Ionicons';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';

....
<MaterialTabs
   items={[
     <Ionicons key='md-call' name='md-call' style={IconStyle}/>,
     <Ionicons key='md-globe' name='md-globe' style={IconStyle}/>,
     <Ionicons key='md-people' name='md-people' style={IconStyle}/>,
     <Ionicons key='md-settings' name='md-settings' style={IconStyle}/>
  ]}
 onChange={this.setTab.bind(this)}
/>
iRoachie commented 6 years ago

Awesome PR man, been meaning to do this for a while. I will see if I can review it this sunday

max-konin commented 5 years ago

Hi @iRoachie. Whats about this PR? Do you have any comments?

max-konin commented 5 years ago

@iRoachie I have no idea why test failed on CI. Local is OK.

iRoachie commented 5 years ago

Works like a charm man! This is awesome stuff!

iRoachie commented 5 years ago

Live in v3.8.0