Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single child doesn't work #48

Open
vanng822 opened this issue Nov 22, 2016 · 1 comment
Open

Single child doesn't work #48

vanng822 opened this issue Nov 22, 2016 · 1 comment

Comments

@vanng822
Copy link

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 added a commit to vanng822/react-native-tabs that referenced this issue Nov 22, 2016
vanng822 added a commit to vanng822/react-native-tabs that referenced this issue Nov 22, 2016
@vanng822
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant