3 ms·
I've been involved in teaching React and FE for more than 10 years (many hundreds of students), and let's be clear here: Students don't understand that JSX is J
by cjblomqvist 2y ago
I've been involved in teaching React and FE for more than 10 years (many hundreds of students), and let's be clear here: Students don't understand that JSX is JavaScript either (and let's be clear here as well; it isn't - it's something that can be transpiled to JS). Rather, people believe it's HTML (since it looks like it), and very much confuses all the differences them in-between - in particularly when mixing with JS (eg conditionals).
Not saying that it's bad necessarily, but there are pros and cons to the JSX approach and the template approach (a lá Vue, or actually Mustache that Vue's template syntax partly comes from).
I think what's easiest/best comes down to:
1. Your background (ppl coming from BE tend to prefer to stay in a more full-blown programming language, people with a HTML/CSS background tend to prefer the template approach.
2. How junior you are. Generally people tend to say that React has more of a learning curve then Vue.
3. What your needs are. Full-blown web apps? Simple small enhancements of static websites? How much detailed/special control do you need or your components HTML output, etc.
PS. @click is actually very similar to the native click attribute. Furthermore, React has className as a special attribute that's definitely on a similar level same-but-not-really.
- recursive 2y ago> React has className as a special attribute that's definitely on a similar level same-but-not-really. The special React-ism that bugs me the most in this area is that React elements map the "change" event to "input". There's no way to handle "change" without getting a ref and wiring it up yourself. As a consequence, most developers don't seem to remember or ever knew what "change" actually is.