3 ms·
The thing I like about React is that I don't have to think about the DOM. As soon as I see "el: #id" it's basically over for me. I don't want to think about DOM
by linkmotif 10y ago
The thing I like about React is that I don't have to think about the DOM. As soon as I see "el: #id" it's basically over for me. I don't want to think about DOM elements, or at least minimize my exposure to them.
And it's not just that I don't like to think about the browser DOM. It's that I don't want my UI coupled to the DOM. Obviously your UI will be coupled to the DOM to some extent, but React minimizes that. What I love about React is not just `react-dom` but also, say, `react-canvas`, or that you can apply the same principles and work with React Native.
But hey, the more software libs to play with and choose from, the merrier! Cheers!
PS. Relay/GraphQL...
- ceejayoz 10y ago> As soon as I see "el: #id" it's basically over for me. There's literally only one of those, to tell what element in the HTML to bind the root Vue instance to. Vue doesn't require thinking about the DOM. It's the same sort of thing as React's basic tutorial (https://facebook.github.io/react/docs/getting-started.html https://facebook.github.io/react/docs/getting-started.html) ReactDOM.render( <h1>Hello, world!</h1>, document.getElementById('example') );
- linkmotif 10y agoOh really? That is good! I was hoping that would be the case, and that my comment would inspire someone to enlighten me. Thank you!
- linkmotif 10y agoPS. What if you're the kind of person who likes coupling presentation and logic? I really like JSX and inline styles. From my skimming, it appears Vue separates templates and logic. Is that correct?
- swsieber 10y agoThen write vue as single file components: https://vuejs.org/guide/single-file-components.html https://vuejs.org/guide/single-file-components.html
- nogridbag 10y agoOn the contrary, for most larger apps you'll want to use single file components + webpack. I'm also a big fan of keeping markup, styles, and logic close together and Vue's single file components are one of my favorite features compared to React components: http://vuejs.org/guide/single-file-components.html http://vuejs.org/guide/single-file-components.html The only downside is that while .vue files do have editor support in most editors, it's still not 100%. For example there are two plugins for VS Code but neither of them are really usable at this time.