Amy Blankenship
1 min readSep 27, 2022

--

Now let's say we need to show exactly the same View, but with data that's coming from somewhere else (let's say maybe somewhere there's a parent that already has a bunch of these it retrieved in a collection, or maybe there's a place some business logic needed to happen on some of these before they're displayed. Now, you have to have multiple versions of this component that all need to be maintained, or you need to cleanly separate your View from the business logic the way you should have up front.

If the shape of your data changes, _yes_, you have to change the business logic that touches it, and _yes_, if that changes how the View displays it, you need to change the View. But that's a terrible reason to drag business logic into your View. It might feel better in the short term, but long term it's going to take huge chunks out of your ( )*( ).

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

No responses yet