React was developed by facebook. Initially released in 2013 to create a dynamic UI for different websites. React is based on the virtual DOM(Document Object Model)which is an in memory representation of DOM elements generated with react components. React is used by facebook, twitter, paypal and many others.
Syntax
Below are the commands for creating a new project for reactJS.
npx create-react-app hello-world
cd hello-world
npm start
React uses JSX which combines javascript with HTML. Here the below code is for hello world.
import React from "react"
function HelloWorld(props) {
return < li >Hello World< / li >
}
export default HelloWorld;
Advantages of React
Disadvantages of React
Angular was developed by Google. Initially released in the year 2010. This is an open-source javascript framework used mainly for single page application development. In 2016 the angular functioning model was changed by the google team and today the angular algorithms are based on typescript,RxJS and Zone.js only. The angular framework uses both javascript and typescript.
Syntax
Below are the commands for creating a new project in AngularJS.
Angular uses both javascript and typescript. This project code compiles typescript into browser compatible javascript code. Here the below code is for hello world in angular
import { Component } from '@angular/core';
@Component ({
selector: 'my-app',
template: `< h1 >Hello World< /h1 >`,
})
export class AppComponent{};
Disadvantages of Angular
Vue also known as vue.js. Vue is the youngest out of the three. It was developed by ex-google ‘Evan You’ in 2014 and has increased in popularity over the past few years.
It was not popular to react. Vue is used by large companies like alibaba , qGag and Gitlab.
Syntax
Below are the commands for creating a new project in Vue.
vue create hello-world
cd hello-world
npm run serve
Here the below code is for hello world in vue.
new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!'
}
})
Advantages of Vue
Disadvantages of Vue
Differences
React | Angular | Vue | |
---|---|---|---|
Current Version | 16.6.3 | 8 | 2.17 |
official Site | react.org | angular.io | vue.js.org |
complexity level | Medium | High | Easy |
Initial heap size(MB) | 8.3 | 8.7 | 7.6 |
Heap size after action(MB) | 15.1 | 15.4 | 16.4 |
Load time | Medium | High | Low |
Data binding | Uni-directional | Bi-directional | Bi-directional |
Model | Virtual Dom | MVC | Virtual DOM |
Used by | Facebook,Uber | Google,Mix | Alibaba,Gitlab |
Survey
According to the stack overflow survey the number of developers using web frameworks is React.