4 ms·
This has changed a number of years ago. Basically it's a component-mindset; create some file with everything in it so that in the rest of the app you can just
by atsjie 4y ago
This has changed a number of years ago.
Basically it's a component-mindset; create some file with everything in it so that in the rest of the app you can just use `<MyButton>...</MyButton>`.
The `<MyButton />` file takes responsibility for everything it does (logic, handlers, markup, style).
However; this does not mean these files should grow large. Instead when things become too big (say over 250 LoC) you split up responsibilities by sub-components.
It's basically dividing problems in ever-smaller problems, but NOT by separating by technology (html/css/js).
Separation of concerns is horizontal slicing of the app architecture, components however slice the architecture vertically.