Fork me on GitHub
#react
<
2022-04-30
>
Benjamin10:04:23

I told a coworker functional react components are a good choice, he answered > the "business"/"view" separation in react is halfway non-existent| do you see any logic in that?

Benjamin10:04:50

judging from my experience with a small re-frame webpage I'm deciding he is just full of shit 😛 Because it split business and view very convincingly to me.

lilactown15:04:42

if you can separate your business logic into pure functions, then it's easy to have react use those pure functions to drive the view

lilactown15:04:37

that being said, it can be difficult to figure out what's "business" logic and what's "view" logic, and React won't help you figure it out. it doesn't care.

👍 2
Aron21:04:15

I understand the response, but not to your suggestion. Functional doesn't mean you have to separate business from view.

Drew Verlee05:05:05

I don't understand what it means to be "halfway nonexistent"

Aron05:05:11

precisely, me neither. But I know that enforcing encapsulation of state in the UI as a separation of concerns leads to low quality UI code

Drew Verlee05:05:54

Yea, the lines are too blurred. It's best to just not get too hung up on it.