You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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.
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.
This should allow more control of the properties, i.e. pass the coordinate information to grandchildren, etc.
https://reactjs.org/docs/render-props.html
The text was updated successfully, but these errors were encountered: