|
|
|
|
|
by ratww
1778 days ago
|
|
I suggest searching what each of those HOCs is doing. This code is not dealing with routing, fetching, managing state or rendering. It is merely "gluing" those things together. Doing that can be considered a "single concern". Over-splitting things only makes them worse to read and understand, even though each sub-component is prettier to look at. Also notice there's a disclaimer on your linked article here the author retracts the recommendation. |
|
That's pretty bad if you need "glue".
> Over-splitting things only makes them worse to read and understand, even though each sub-component is prettier to look at.
React is a UI technology, and only your view layer should know about the React stack. The model layer should be UI-technology agnostic (includes avoiding Redux etc.) and so should most of the controller layer. If something better than React comes along (and it will) only the view layer should need to be rewritten.