--

Hi Jack,

very interesting article :)

The pattern you described is actually very similar to the "render prop" pattern (https://reactjs.org/docs/render-props.html).

I think it is good to know both of them and use them where they fit better. Compound components seem to be more readable when there are more "render props". If there is just one or two things to render, I prefer to just pass them as props.

Kind regards

Krzysztof

--

--

Krzysztof Kwieciński
Krzysztof Kwieciński

Written by Krzysztof Kwieciński

Software Craftsman who loves learning new things and is always eager to share his knowledge with others

Responses (1)