4 ms·
> the biggest benefit is the complete separation of logic from semantics. Then maybe allow JSX? The way I write my React components, the view is what you find
by tchaffee 9y ago
> the biggest benefit is the complete separation of logic from semantics.
Then maybe allow JSX? The way I write my React components, the view is what you find in the `render()` method, and there is little to no logic there. The big selling point for me with React is that I no longer have to learn yet another templating language. Which seems to be somewhat where you are leaning as well. But being able to read HTML as, well HTML (or something very close like JSX), has a lot of benefits. Just going between code and the browser debugger for example. The mental step of translating between what I see in the browser and what's in my code, is in fact a step.
- jugularkill 9y ago"The big selling point for me with React is that I no longer have to learn yet another templating language." Hmm, I get the impression you're tired of having to learn something new and you're happy to stick with what just works for you. . I understand but I'm not sure everyone feel that way, but I would be honest enough to say I think most people in FE development are on your wavelength. Here's the entire syntax documentation: - Tags are functions - Attributes + props are object literals - Strings are text nodes, - Remaining parameters are child elements It's nothing but basic JavaScript. The separation is not enforced by API it's a discipline that can't be forced into React via JSX as far as I've tried. Here you have: - No transpiler - No logic mixed in semantics - No vague component separation - No wrapping everything in a div (use ...spread) - No new syntax to learn Maybe it's not for you, but the advantages are more than obvious.