ReactJS -Why one should use it ?

Rajat Sehgal
5 min readDec 11, 2018

--

If you are fresh in the field of developing, then you are at right place to know why reactjs is best option to start with. In fact every backend developer who wants to be full stack can dive into frontend from reactjs as the prior programming language it wants is javascript. And not only one can make web UIs but also develop mobile applications both for android and ios by using react native and virtual-reality (VR apps) by using react-vr.

ReactJS is used to make the interactive UIs by rendering the UI components and making a complex UI by encapsulating them all, and it is easy to handle each component as they can manage their own state.

What’s rendering? This is the word which you are gonna use and hear while learning reactjs, in simple words it is the process of transforming your react components into DOM (Document Object Model) nodes that your browser can understand and display on the screen.

Getting started with the reasons that WHY REACTJS ?

EASY TO USE
The one with basic prior knowledge of javascript is good to dive into react as compared to learn AngularJS, as being the component-based approach and having different syntax JSX ( where one can couple html with javascript ) makes it easy to build complex UIs.

REUSABILITY
Each react component manages their own state and can be re-used anywhere you need. As a result your app grows consistently and code reusability makes it easier to maintain.
Rendering logic is quite cool — As now it is easy to handle the data and couple it with UI , and one more advantage for developers is that they can create large web applications which can change data, without reloading the page (dynamic state change of data).

FAST AND SCALABLE WITH VIRTUAL DOM
Making it simple for you that how actually virtual DOM works?
So Whenever you make any changes to your running React application, such as entering text, removing an element, adding an element, etc, React will batch all of these changes together in its Virtual DOM, then compare this representation with the actual DOM, find what needs to be updated, and then make the smallest possible changes to the real DOM to keep them in sync while keeping the application performant.

Interesting story about Virtual DOM is that, Facebook actually wasn’t aware of that refreshing of the partial DOM (some part of the actual DOM) will make the process faster. Facebook was just seeking for the method to reduce the rebuild time, but because of partial DOM reloading, its consequences became cherry on the cake as it increased the performance and programming speed.

REACT BEING STUPENDOUS FOR MOBILE APPLICATIONS, REACT NATIVE !!!

Just as in case of ReactJS we can build web UIs and we use React DOM. ReactDOM library is just to render the elements of react to the browser, but react is helpful for turning the react app into a native mobile app for Android or iOS, using react-native library. React Native compiles to native app components, which makes it possible for you to build native mobile applications both for android and ios. In both cases (React DOM and React Native) syntax and workflow remain similar, but the components are different.
React Native allows developers to reuse the common logic layer for iOS and Android so that you don’t need to build the same application for both from scratch.

“Now we are gonna make VIRTUALITY as REALITY”

React VR — An experience in 360°
Apart from jokes, here is another usage of react in the field of virtual-reality application development, it’s my favourite. We are talking about React VR.

VR in the last couple of months has changed the experience of watching 3D movies and experiencing games in VR, which seems to like experiencing some virtual state.
VR in the last couple of months has changed the experience of watching 3D movies and experiencing games in VR, which seems to like experiencing some virtual state. That’s what VR do, it moves your focus from the current state and makes you focus on virtual state. You have heard about Oculus rift, Google cardboard, Samsung gear VR, these are some of the vr gadgets with which you can experience VR.

It’s not a new medium, but due to rapid technology progress, VR’s popularity is thriving like never before. Alongside with Augmented Reality, VR seems to be the next computing platform.
As we have gone through the introduction of react, so starting with react vr will be fun as programming is quite familiar to reactjs, in short same syntax and workflow but different components. React VR uses WebGL (allows rendering 3D objects in the browser) and WebVR (allows you to sync with VR headsets) libraries (standard libraries which are used for vr app development). Basic components used in it are similar to react native components and we use Three.js javascript library, which is used for displaying animated 3D graphics, in short it is a 3D rendering engine.

Finally, we came to an end by having brief knowledge about what React can do and why it is best option for starting and to explore different zones (ReactJS, React Native, React VR) from single point (React).

ReactJS web application tutorial is coming soon, we are gonna have fun with both react and play with some database.

--

--