Open Ross-Esmond opened 5 years ago
To be clear, I'm referring to the use of arrow functions to wrap the jsx. Not the passing of children into properties.
I agree that in this case arrow function is not really doing anything but the goal really was to show that you can pass function as props that will return what to render. Maybe instead of getting rid of the arrow function it's better to change the exercise slightly so that the caller is passing some data to the render props!
Yep, and that makes since. Although I would still suggest removing the functions in favor of a simpler, more direct approach. Most of your tutorial focuses on building an understanding of the fundamentals. Which is good, because that's actually where most people struggle. I just wouldn't want someone to conflate composition with render props specifically. Composition through children passing is a strong enough tool to get a dedicated section.
The use of render props is misguided in the Card example. Render props allow a parent component to provide data to a render without having to explicitly know what its children are. If a render prop takes no arguments it should just be swapped out for static JSX.