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

Support renderProp? #19

Open
Secretmapper opened this issue Feb 19, 2018 · 2 comments
Open

Support renderProp? #19

Secretmapper opened this issue Feb 19, 2018 · 2 comments

Comments

@Secretmapper
Copy link

This should allow more control of the properties, i.e. pass the coordinate information to grandchildren, etc.

https://reactjs.org/docs/render-props.html

@ethanselzer
Copy link
Owner

@Secretmapper - Thanks for suggesting the render-props pattern. I think if I were creating this library today, I might use it. Other than the convenience of passing props directly to deep descendants, I'm wondering what you think the benefits of the render-props pattern are over the currently implemented "decoration" pattern.

@Secretmapper
Copy link
Author

I'm not really sure 🤔. The real main use case I can think of is with props passing to deep descendants, as I have a use case where I need to keep track of the coordinates in a larger container, but only a deeper component handles the data.

There's already a way to do it in user space in the current API as I can write a component that wraps them in this way but it's a level of indirection that would be solved with renderProp.

If ever, do you think it best to migrate or keep both APIs and let the user decide? I'll try to submit PR soon.

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

2 participants