react-native-tabs icon indicating copy to clipboard operation
react-native-tabs copied to clipboard

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

Open AndiDemon opened this issue 7 years ago • 2 comments

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>

AndiDemon avatar Aug 01 '17 06:08 AndiDemon

same problem

PhamLinh0889 avatar Aug 23 '17 10:08 PhamLinh0889

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.

ziyafenn avatar Nov 09 '17 11:11 ziyafenn