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

Single child doesn't work

Open vanng822 opened this issue 9 years ago • 1 comments

If you run this code it will throw this error "TypeError: this.props.children.filter is not a function" <Tabs> <Text name="test">Test</Text> </Tabs>

I have been trying to understand where the problem is but hard to find. Most probably it comes from JSX or react. Open this ticket in case anyone is more involved and understand this issue.

One can add a "null as child" to avoid this issue.

vanng822 avatar Nov 22 '16 07:11 vanng822

My use case is that I build the tab dynamically corresponding user's permissions. It could be zero or more. I guess that you could solve it other way but I think this is nice. I fixed for case zero, one or many children. If you guys think this is useful I can create a PR for further review.

Thanks VN

vanng822 avatar Nov 22 '16 08:11 vanng822