aksonov/react-native-tabs

not working using <Tabs><View name="">

Opened this issue · 2 comments

I am new in react-native and using this plugin,
it simply work to my code,
the simple code using on the is totally work.
but somehow I need to insert inside the , but it is not possible in react, so I changed the code to any other code and found the error "undefined is not an object (evaluating 'el.props.name')", how it used to be? to using inside the
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.