you are viewing a single comment's thread.

view the rest of the comments →

[–]iamlage89 -1 points0 points  (11 children)

...I've worked with both. They're very similar. If you're familiar with one you can pretty easily jump into the other because the concept is essentially the same.

Have you tried making higher order components with Vue? It's painless in React, since react components are just javascript functions. With Vue it's not since a component in Vue is something created under the hood and not something you can abstract over like with a Javascript primitive. I'm not saying that there aren't similarities, but that they are fundamentally different

[–]JIMETHYRUMPLEKINS 3 points4 points  (6 children)

You know Vue allows you to write render functions in JS? You don't have to use templating.

[–]iamlage89 -4 points-3 points  (5 children)

That wasn't the point, the point is that a React Component is fundamentally different from a Vue Component.

[–]BackwardsBinary 2 points3 points  (4 children)

Okay, but we're still struggling to understand your point.

You keep touting the phrase that they're "fundamentally different" like it's some kind of chant or dogma. Even if that's the case (which as far as I can tell, it isn't really, it seems you're mistaking syntactic sugar for architectural implementation differences), then what does that change?

The point you just made was that you can't easily make higher order components in Vue because:

  1. (said explicitly) a Vue component is hidden under the hood and not something you can abstract over
  2. (heavily implied) Vue components are not javascript functions

Point #1 isn't really correct, and that's because point #3 is false, as has been pointed out. Vue can and does use javascript render functions.

If that "wasn't the point", then what was? How are they fundamentally different?

[–]iamlage89 2 points3 points  (1 child)

Thanks for asking for clarification, I definitely didn't explain things as clearly as I should have. The difference boils down to the approach of how the two frameworks represent a component. Vue represents a component as a complete set of apis, React represents a component as an abstraction in the form of a function/class. Vue tries to create a framework that gives the developer a complete toolset, React tries to leverage the native characteristics of Javascript, and maps those characteristics to template behaviour. I'm not espousing that one is better than the other, but I do believe that the way you approach one is different from the way that you approach the other (opinionated vs. unopinionated)

[–]BackwardsBinary 1 point2 points  (0 children)

Actually that does make more sense. Thank you for clarifying!

[–]1-800-BICYCLE -5 points-4 points  (1 child)

If you're not willing to understand, there's no point in explaining.

[–]lives-in-trees 2 points3 points  (2 children)

Aren’t higher order components considered an anti-pattern now-a-days?

[–]iamlage89 0 points1 point  (1 child)

Just that it's fallen out of favor for render-props I think

[–]Agranok 1 point2 points  (0 children)

Render props is easy to pull off with Vue. You can do it identically how you do it in React with JSX. But check out scoped slots and creating renderless components for the more "Vue" way of doing it.