Join the DZone community and get the full member experience.Join For Free
It is open-source and maintained by Facebook and a community of individual developers. React was originally written by Jordan Walke as an internal Facebook tool. It was then open-source and released to the general public in 2013, and gained great popularity thereafter.
Some of the features include the following.
- Provides responsive, customizable, and reusable components.
- Use a virtual DOM.
- Extremely fast.
- One-way data link.
- Code reuse.
- It has a vibrant and thriving ecosystem behind it.
- Practical management of condition management.
React can be used on the frontend in two different ways.
- On CDN
- Using Node.JS
You can refer to their official site for a script link, which you can include in the header tag of your HTML markup. Choose the links according to the objective.
For example, if you are using in a development environment, then:
And, for production:
I'm assuming you have NodeJS installed already. To install React, just type the following command.
sudo npm i -g create-react-app --save-dev
Once the installation is complete, type the following command:
The above command will install all the libraries needed for React to run properly, which includes a dev server, web pack, and babel.
Go to the
my-first-react-applicationfolder and run the following command:
The above will launch a development server on port 3000. And, when you access your server's IP address with port 3000, you should see something like below.
React is growing in popularity and on-demand by a number of large organizations.
Vue.js is open-source and was originally created by Evan You and released publicly in February 2014. Here are some of the features.
- It provides responsive and composable view components.
- Use a virtual DOM.
- Stay focused on the core library (i.e., routing and state management).
- The scope in CSS is managed without CSS-In-Js.
- Unidirectional connection within the components.
- Support for essential addons.
- Code reuse.
You can use Vue.js on the front-end via CDN or with Node.js
To use the CDN Way, you can add the following script to your HTML page header section.
The above script is suitable for development purposes because it includes an important console message. However, for production, you need to use the one below.
And for use with Nodejs, you can install it using
I strongly advise you to read the official Vue JS Documentation to learn more or consider taking this path.
Make sure the latest Nodejs is installed. The first thing we will need to install is the Angular CLI tool.
npm install -g @angular/cli
Once installed, we can create a new project with the following command.
Follow the instructions on the screen. This generates some files and folders and uses the
npmadd-on to download third-party libraries needed for Angular to work properly.
To start the newly created app, run the following command from the apps folder.
This should automatically start the server on port 4200.
So what you choose to learn is more of a personal preference than "what's best."
All of the frameworks/libraries listed above are excellent. Here is a brief recap;
- You have to learn Angular if you want a Framework that you want to build on without having to deal with external dependencies.
- You should learn to React if you want to build a PWA, Single Page application quickly and are comfortable with JSX.
- React has the most vibrant community and more job opportunities due to its large community.
- React is relatively easy to use.
- React is highly customizable and treats every UI element as a component.
- Vue has the same benefits as React but without JSX.
- Vue's job market is constantly growing.
Opinions expressed by DZone contributors are their own.