Re:How I write React after 8 years
by basicallybones on Thursday July 28, 2022 @11:38AM
(#32265801)
I'm not the original commenter, but see the 2019 update on this Dan Abramov article: https://medium.com/@dan_abramov/smart-and-dumb-components-7c...
Re:How I write React after 8 years
by lmiller1990 on Thursday July 28, 2022 @06:48PM
(#32270973)
I'm still not really sold; obviously not good to be overly dogmatic, but MVC taught us the value in putting business (M) in a separate module to the view (V) and hooking them up via a controller (C). Why does all this knowledge suddenly get throw out the window?
> Decoupling logic from components: 100% never do this. Ever.
Care to elaborate? I much prefer to decouple my business logic from my components - mixing logic with the view layer doesn't seem like a great idea, at least ime.
I've also had a good experience with a single folder containing all the relevant code for a component (types, style, test, etc).