4 ms·
It's done this way to collocate related (business) concerns. The views are in their own functions and don't contain any logic and, yes, they can be pushed into
by sodapopcan 3y ago
It's done this way to collocate related (business) concerns. The views are in their own functions and don't contain any logic and, yes, they can be pushed into separate template files if that's what you prefer. This has been a thing since React came out and its merits have been debated to death already.
- pmarreck 3y agoI noticed this in React and it's also a reason why I didn't like React. Fortunately or unfortunately, I've never had occasion to use React in prod. lol. Can you point me at any of the debates you mentioned so I can catch up? In Rails this would have been a "partial" with some underscored filename
- sodapopcan 3y agoI assume searching for "JSX sucks" would do it. I certainly haven't bookmarked any debates from the past 10 years, lol. Incidentally JSX is the only thing I like about React. I find components are much more flexible and cohesive than partials (Rails was my thing for years and I still have a soft spot for it). But to each their own and I no longer enjoy debating it!
- pmarreck 3y agothat’s cool, I just missed them, I didn’t want to participate in them, I just wanted to catch up
- madeofpalk 3y ago"Seperation of concerns, not technology" is the line often brought up in React circles.
- sodapopcan 3y agoHa, yes, I've been saying this since long before React (I don't actually use React). We were never doing "separation of concerns" even in the 2000s/2010s, simply separation of languages.