News for hackers. Stuff that matters.
Re:Vue.js vs. React: what happened in 2017 by tomonl on Sunday December 24, 2017 @02:21PM (#16000888)
It works in the <script lang="ts"> part of your .vue file, but not the <template> part.
Re:Vue.js vs. React: what happened in 2017 by ng12 on Sunday December 24, 2017 @03:05PM (#16001077)
Ah, that's a bummer. Vue Templates seem wildly regressive to me -- I can't fathom going back to stringly-typed Handlebars wrangling after using JSX/TSX.

After looking into this further it seems like Vue Templates also differentiate between values and components. In React I often write components which can take in either: a good example is text which the consumer might want to format. You can easily write the component so that they pass in a string or a <span /> element.

Vue has a lot of good ideas but the templates are almost a non-starter for me.

Re:Vue.js vs. React: what happened in 2017 by CaveTech on Sunday December 24, 2017 @03:23PM (#16001163)
You can use slots to pass HTML or Components into child components.

You can have vue render jsx or templates, but in practice you can make interactive components very simply using templates which are foundationally simpler and easier to grasp than JSX.

Re:Vue.js vs. React: what happened in 2017 by ng12 on Sunday December 24, 2017 @04:13PM (#16001316)
How so? In my mind templates and JSX are equally complex from a user standpoint. In fact I'd argue that JSX is simpler because you don't have to invent slots -- it's an obvious side effect of using JavaScript to generate your structure.

Just reading about slot and slot-scope makes me think Vue's reputation for simplicity is overblown.

Re:Vue.js vs. React: what happened in 2017 by ricardobeat on Sunday December 24, 2017 @05:10PM (#16001562)
It may seem "obvious" to you after being in the water with JSX for a while, but the free-style abstractions afforded by being 'just' JavaScript, like the one you mention, look incredibly complex for someone approaching an unknown codebase.
Re:Vue.js vs. React: what happened in 2017 by faitswulff on Sunday December 24, 2017 @03:19PM (#16001148)
You don't have to use the templates, though. Define a render function and you can even use JSX in it: https://vuejs.org/v2/guide/render-function.html#JSX
Re:Vue.js vs. React: what happened in 2017 by ng12 on Sunday December 24, 2017 @04:05PM (#16001294)
Why wouldn't I just use React at that point? Same behavior, less complexity.
Re:Vue.js vs. React: what happened in 2017 by Mary-Jane on Sunday December 24, 2017 @04:43PM (#16001436)
I agree; using JSX outside React feels kinda silly. But Vue is much simpler to grok than React.
Re:Vue.js vs. React: what happened in 2017 by cc81 on Sunday December 24, 2017 @06:42PM (#16001863)
I believe React is very simple and easy to understand.

Redux is not as easy but you can go with MobX instead for easier state management.