DEV Community

Discussion on: A tale of Higher-Order Components & Render Props

Collapse
 
lobo_tuerto profile image
Víctor Adrián

Wouldn't going with Render Props from the beginning allow you to model the 3 use cases just as smoothly?

(Sorry if this is a silly question, I don't know React).

Collapse
 
pepesenaris profile image
Jose Javier Señaris

No silly questions. Sure it will be possible. The point here is that several developers worked on the feature step by step. Each choose what it seems a good enough solution at the time and the code evolved slowly from one pattern to the other. The main take away here is to not freeze development by not deciding which pattern to use

Collapse
 
lobo_tuerto profile image
Víctor Adrián

Got it, thanks for the reply!

Now, if you had to do it all over again, would you still contemplate HoCs or with the newly found experience would you go directly to Render Props?

Thread Thread
 
pepesenaris profile image
Jose Javier Señaris

Probably, having all this requirements first hand, I would go with render props. Only to use the same style and for mere personal taste.