Suggestion: Render props via render prop
See original GitHub issueHey, what do you think about adding render prop to the component for the render props pattern?
Say:
<ScrollTo render={
(scroll) => (
<a onClick={scroll(0, 500)}>
Scroll to Bottom
</a>
}
/>
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
How to create a render prop component | by Sean McPherson
At its core, render prop is “a simple technique for sharing code between React components using a prop whose value is a function.”...
Read more >An Overview of Render Props in React - CSS-Tricks
Using render props in React is a technique for efficiently re-using code. According to the React documentation, “a component with a render prop...
Read more >React's Render Props technique in 3 Minutes - codeburst
A technique for sharing logic between components. Components accept a prop that returns a function responsible for rendering something.
Read more >Testing ⚛️ components using render props - Kent C. Dodds
So how do you test a component that uses a render prop component? Whelp, if you're using E2E or Integration tests, you pretty...
Read more >Suggestion to change documentation on <Route>'s render prop
Naming the render prop props as routerProps instead of props . I suggest doing that also for other examples that name the routerProps...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@JikkuJose Definitely on-board with render props (Michael Jackson sold me also)!
Let’s keep to the discussion of a
render propin addition tochildren render prop. Unless we find a clean solution to the issues @newyork-anthonyng proposed, we should stick to just using thechild propas a function. I want to keep a small API footprint, so the less special cases, the better.@ganderzz didn’t meant to bad mouth HoCs but somehow I am sold to render props after listening to a talk by Michael Jackson.
Have already commented on the issue, but I wonder whether its even possible!