4 ms·
Of course React got it right because there's no violation of separation of concerns involved. JSX is just syntactic sugar on top of method calls. One is perfec
by bauerd 9y ago
Of course React got it right because there's no violation of separation of concerns involved.
JSX is just syntactic sugar on top of method calls. One is perfectly free to extract the `render` functions into separate files and call them "templates". Unless the argument is that virtual DOM libraries are an inherently bad idea, I don't see what's to complain about separation of concerns.
- stdbrouw 9y agoSeparation of concerns is about both the structure of a piece of code (which is what you refer to) and about how it is organized in files, folders and mentally (which is what others refer to).
- bauerd 9y agoAs I said, you're free to do this to yourself. Put every function that calls `React.createElement` in a separate file/directory and import it.