JavaScript

Vue vs React | Which is better Vue or React?

Which is better Vue or React?
Why is Vue better than React?
1.      Vue and React are similar in performance
2.      Both, React and Vue has a Virtual DOM
3.      Vue handles CSS is quite nice as compared to React
4.      React has a broader library than Vue

What is the difference between Vue and React?
React uses JSX code and Vue uses JavaScript code. So learn point of view, React is less comfortable for beginners as compared to JavaScript. Also, we can say that the React has greater time to learn as compared to Vue.

The Example,

How do we delete from the list?

React:
deleteItem = indexToDelete => {
    this.setState(({ list }) => ({
        list: list.filter((toDo, index) => index !== indexToDelete)
    }));
};

Vue:
onDeleteItem(todo){
  this.list = this.list.filter(item => item !== todo);
}

How do we pass event listeners?

React:
<button className="ToDoItem" onClick={this.createNewToDoItem}>Click..</div>

Vue:
<button class="ToDoItem" @click="createNewToDoItem()">Click..</div>
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.
^