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

Avoid explicit usage of children in the documentation #6

Closed
ncuillery opened this issue Jan 27, 2020 · 3 comments
Closed

Avoid explicit usage of children in the documentation #6

ncuillery opened this issue Jan 27, 2020 · 3 comments

Comments

@ncuillery
Copy link
Contributor

I find a bit weird to show an explicit usage of the children props:

<ActionSheet
  children={<View/>}
/>

instead of

<ActionSheet
  <View/>
/>

I have never seen this before
Even if it syntaxically correct, it adds verbosity for... nothing?

What do you think?

@ammarahm-ed
Copy link
Owner

At a point I thought that too, why use children and not just wrap everything inside the ActionSheet. It can be done in both ways, and I have mentioned both of them in the documentation.

<ActionSheet>
<View/>
</ActionSheet>

I still think it doesnt make a difference as its possible in which ever way you like and mentioned in the docs too. what do you think?

@breynolds-dev
Copy link

For what it's worth there is a rule for the react eslint that recommends using it wrapped instead of passed as a prop.

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md

While it may be the same thing under the hood, I agree that wrapped is a little more clear as to what's happening with the components.

@ammarahm-ed
Copy link
Owner

After a bit of research I have removed children usage from the docs. I am closing this issue now as it has been fixed. Thanks @ncuillery and @breynolds-dev for making it clearer to me.

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

3 participants