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

RFC: Use <Subscriber render> instead of <Subscriber children> #44

Closed
mjackson opened this issue Nov 29, 2017 · 3 comments
Closed

RFC: Use <Subscriber render> instead of <Subscriber children> #44

mjackson opened this issue Nov 29, 2017 · 3 comments

Comments

@mjackson
Copy link
Member

I'm personally starting to prefer using render instead of children whenever I'm using a render prop. But that may just be me.

@j-f1
Copy link
Contributor

j-f1 commented Nov 29, 2017

👍 I feel like children should be reserved for JSX because that’s what you can put inside <Component>...</Component>.

@fatfisz
Copy link

fatfisz commented Dec 18, 2017

I'd compare using function in children to using thunks in Redux - you don't get the actual child, but something that you can call to get the child.
In this sense it's natural that there cannot be any other child other than the one between the tags, whereas with the render prop it feels (IMO) like a second API to do the same thing, just like the explicit children prop (i.e. <Compo children={something} />).

I think using function-as-children shouldn't feel any different from using thunk-as-action. On the other hand, not everyone fancies Redux 😉

@mjackson
Copy link
Member Author

I think we'll just leave it at children for now. That's sort of the universally expected "render prop".

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

No branches or pull requests

3 participants