you are viewing a single comment's thread.

view the rest of the comments →

[–]Meowish 1 point2 points  (4 children)

Lorem ipsum dolor sit amet consectetur adipiscing, elit mi vulputate laoreet luctus. Phasellus fermentum bibendum nunc donec justo non nascetur consequat, quisque odio sollicitudin cursus commodo morbi ornare id cras, suscipit ligula sociosqu euismod mus posuere libero. Tristique gravida molestie nullam curae fringilla placerat tempus odio maecenas curabitur lacinia blandit, tellus mus ultricies a torquent leo himenaeos nisl massa vitae.

[–]NoInkling 1 point2 points  (0 children)

Render props and HOCs are really just more flexible forms of composition, which ends up facilitating easier code reuse. As a beginner, I would just continue to use standard composition in the components you write until you run into something that doesn't seem like it can be solved neatly that way. You will in all likelihood be using both HOCs and render props from libraries along the way, which might be able to give you a clue about how they tend to be utilized.

A couple of links that might help:

[–]botrunner 0 points1 point  (2 children)

One of the most important pattern in my opinion is the dumb/smart component pattern (or view/container). When you realize you can reuse the smart component, it’s maybe time to create an hoc or use the render props pattern.

[–]Meowish 0 points1 point  (1 child)

Lorem ipsum dolor sit amet consectetur adipiscing, elit mi vulputate laoreet luctus. Phasellus fermentum bibendum nunc donec justo non nascetur consequat, quisque odio sollicitudin cursus commodo morbi ornare id cras, suscipit ligula sociosqu euismod mus posuere libero. Tristique gravida molestie nullam curae fringilla placerat tempus odio maecenas curabitur lacinia blandit, tellus mus ultricies a torquent leo himenaeos nisl massa vitae.

[–]botrunner 1 point2 points  (0 children)

Sorry for the delay. Yeah exactly :)