3 ms·
This sounds like a misunderstanding to me. “JSX/Babel/webpack” aren’t any more required for React than for Vue. Here’s how to use React without them: https://re
by danabramov 7y ago
This sounds like a misunderstanding to me. “JSX/Babel/webpack” aren’t any more required for React than for Vue. Here’s how to use React without them: https://reactjs.org/docs/add-react-to-a-website.html https://reactjs.org/docs/add-react-to-a-website.html
Just drop it as a script on the page.
Ironically, my understanding is that it’s Vue that requires a compiler for even basic component support. If you don’t use webpack or similar tools with Vue, as far as I know, you can’t declare an idiomatic reusable Vue component.
With React, whether you use Babel/JSX/Webpack or not, components are always available. They’re the whole point.
I think it’s fair to say that Vue is initially more familiar to and easier to get started with for folks who are more comfortable with HTML. React is more JS-centric. Even though in the end they render the same DOM elements.
- tannhaeuser 7y agoHm, then it's indeed a misunderstanding on my side. I definitely need to take a look into vue, but I thought people were choosing it over React because they didn't like JSX but would prefer straight HTML (though again, I don't know vue and how it would be possible for vue to render components based on just HTML syntax).
- danabramov 7y agoVue offers a more gradual learning curve coming from HTML. Because in the beginning, you don't write components in JS at all. Instead, you can use Vue "directives" like `v-if` right inside your HTML. Later, when you're ready for components, you have to add a compiler. React takes a different approach. It doesn't "pretend" to be HTML by extending it with custom directives. Instead, it forces you to start the journey in JS land. That can be frustrating at first if you're unfamiliar with JS. But the gap between "simple" and "complex" is smaller: you learn the idea of components once, and can apply it with or without a toolchain.
- codingdave 7y agoThat is the exact reason I prefer React - Vue feels like you are mixing HTML and code when you start adding in the directives. JSX feels quite natural to me, in particular because it provides an easy mechanism to code with a clean break between the app logic vs. rendering. I know at the end of the day, they both still come out as HTML and JS in the browser, but React just feels cleaner. At least to me.