17 ms·
You are using your gut feeling, but that's not how React works at all. JSX is not HTML, mixing logic/presentation is not a concern because you're not dividing
by hcarvalhoalves 11y ago
You are using your gut feeling, but that's not how React works at all.
JSX is not HTML, mixing logic/presentation is not a concern because you're not dividing your rendering between backend/frontend, and finally you don't even have to care about the final HTML representation of your component, it's just an implementation detail.
Finally, it's all declarative since you're never modifying a DOM tree - and declarative is a pre-requisite for good UI frameworks.
- EugeneOZ 11y agoI use my years of experience, I don't need gut feeling for it. I really don't talk about backend, absolutely. While we have "createElement", we will use it with conditional cases and as result we will have mess of NOT-BUSINESS-logic and HTML code.
- hcarvalhoalves 11y agoIf you're using createElement you're doing it wrong.
- EugeneOZ 11y agoExactly! It's shortest version of what I think about JSX.
- tomjen3 11y agoI am playing around with React and if you want to keep it JSscripty (being the only dev who actually likes JS) or you want to use coffee script then createElement isn't actually horrible to use. Especially not if you make an alias to ce or something like that.
- azerothian 11y agoif you want the best of both worlds, i use cjsx (https://github.com/jsdf/coffee-react https://github.com/jsdf/coffee-react) for my react components e.g. https://github.com/Azerothian/reacta-test/blob/master/react/template.cjsx https://github.com/Azerothian/reacta-test/blob/master/react/...