react-native-tabs
react-native-tabs copied to clipboard
not working using <Tabs><View name="">
I am new in react-native and using this plugin,
it simply work to my code,
the simple code using <Text name> on the <Tabs> is totally work.
but somehow I need to insert <View> inside the <Text>, but it is not possible in react, so I changed the code to <Tabs><View name="">any other code</View></Tabs> and found the error "undefined is not an object (evaluating 'el.props.name')", how it used to be? to using <View> inside the <Tabs>
this is my Code
<Tabs selected={this.state.page} style={{backgroundColor:'white'}} selectedStyle={{color:'red'}} onSelect={el=>this.setState({page:el.props.name})}> <View name="cerita"> <Text>Cerita</Text> </View> <View name="search"> <Text>Search</Text> </View> <View name="notify" selectedStyle={{color:'green'}}><Text>Belum</Text></View> </Tabs>
same problem
I'm looking for a similar solution where it would also work with <View>
component instead of <Text>
.
Is there any possible solution to make it work?
What i've actually done, is created a separate component for tab child items doing so:
export const TabItem = ({name}) => (
<Text name={name} selectedStyle={styles.selected}>{name}</Text>
);
I want to be able to use it inside of the <Tabs>
but it doesn't work.
Thanks.