React is a declarative, efficient, and flexible JavaScript library for building user interfaces.
A Brief History of React.js
Facebook created React.js in 2011 for their use. As you know, Facebook is one of the biggest Social Networking websites in the world today.
In 2012, Instagram also started using it, which is a subsidiary of Facebook.
In 2013, Facebook made React.js open-sourced. Initially, the developer community rejected it because it used Markup and JavaScript in a single file. But as more people experimented with it, they started embracing the component-centric approach for separating concerns.
In 2014, many large companies started using React.js in their production environments.
Prerequisite
Before learning ReactJS in-depth, you must have a good knowledge of JavaScript, HTML5, and CSS. The knowledge of ECMAScript 2015 syntax can also be helpful.
Why React.js is important?
React is Flexible:
React is remarkably flexible. Once you have learned it, you can use it on a vast variety of platforms to build quality user interfaces. React is a library, NOT a framework. Its library approach has allowed React to evolve into such a remarkable tool.
Great Developer Experience:
Anyone will fall in love with React when they start coding in it. Rapid development and React's small API combined create a fantastic developer experience. React's API is very simple to learn. It has very few concepts to learn.
React Has Broader Community Support:
Since 2015, React's popularity has grown steadily. It has a massive active community and its GitHub Repository has over 164k Stars. It is one of the Top 5 Repositories on GitHub.
React's NPM package has millions of weekly downloads as well.
Over 9K companies reported on Stack share that they are using React. You can even see Fortune 500 companies.
React Features:
Use JSX: JSX is faster than normal JavaScript as it performs optimizations while translating to regular JavaScript. It makes it easier for us to create templates.
Virtual DOM: Virtual DOM exists which is like a lightweight copy of the actual DOM. So for every object that exists in the original DOM, there is an object for that in React Virtual DOM. It is the same, but it does not have the power to directly change the layout of the document. Manipulating DOM is slow, but manipulating Virtual DOM is fast as nothing gets drawn on the screen.
One-way Data Binding: One-way data binding gives you a better view of your application.
Component: A Component is one of the core building blocks of React. In other words, we can say that every application you will develop in React will be made up of pieces called components. Components make the task of building UIs much easier.
Performance: ReactJS use JSX, which is faster compared to normal JavaScript and HTML. Virtual DOM is a less time taking procedure to update webpages content.