Why Do Developers Now Compare Vue.js to JavaScript Giants Angular and React?
Ranjeet Kumar
711

Thanks for sharing some good ideas on this subject , as a React developer I have some thoughts about some things..

“#2. React is all about JavaScript, often making reinvention of HTML and CSS within JavaScript a painstaking task. “

Personally I have found the rendering and incorporation of HTML/CSS one of the easier tasks with React. React’s abstraction over the DOM in JSX often makes things easier when you actually do not need to know the internals of the DOM or reference a particular element by id or use a separate template/html file which IMHO tends to increase complexity with more binding logic and learning a new syntax.

CSS can be applied with class names or inline with the same principle as you do normally.

“ Also, the render function in React (or JSX) often involves a lot of logic..”

Typically the render function should not have any (business) logic in it at all and you actually do not need a render function at all (see example below).

“..and does not provide a visual representation of the interface.”

This one I do not get, you have very HTML like code with JSX and if you separate concerns it is as readable as a angular or vue template…

#4. Vue’s two way data binding is simpler than React’s.

It is worth mentioning that React has intentionally left out “magic” functionality for 2-way databinding and recommends 1-way dataflow since it is sometimes easier to reason about your logic and track bugs when there is a 1-way dataflow. This suits some apps but not all of course.

Vue’s 2 way databinding is easier in regards to lines of code but not as explicit and clear of intentions as React’s way, consider if your example would be like this where a container component would handle the state:

const Message = ({ message, handleChange }) = (
<div>
<input type=”text” onChange={ handleChange } />
<span>{ message }</span>
</div>
)

It is easier to test your rendering and there is no binding logic or side effects like references to a particular element id or model, it is simply a completely contained component.

Like what you read? Give Daniel P a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.