DEV Community

Cover image for How is React different from vanilla JS
Aman Sethi
Aman Sethi

Posted on

How is React different from vanilla JS

Vanilla Js

VanillaJS is a name to refer to using plain JavaScript without any additional libraries. All major web browsers have a built-in JavaScript engine that executes the code on the user's device. It is the language to communicate with the browsers directly. Let it be any framework Angular, React, etc they are all built on top of vanilla JS. When making small web apps using vanilla JS or any of the framework wouldn't make any big of a difference. But when there are more functionalities to be added code gets messier.

React

It is a framework built on vanilla JS. Think of it as the middleware to communicate with the browser. Modern browsers provide many functionalities that improve user experience and provide good visual animations also. To communicate with the browser we use vanilla JS. But the code gets many times too long making things look complicated in vanilla JS. React hides these complexities and let a developer access the features of the browser using less code. Also, I would like to remind you here that React is a declarative language for this reason.

React is a Component-Based framework. This means components are once written and used multiple times within the app. In vanilla JS it is not the same case as everything has to be hard-wired to make things work.

React can also render on the server using Node and power mobile apps using React Native.Many companies use React Native for their mobile app because the same code can be deployed to both Play Store and App Store.This helps them ship out new features and information to their users in less time.

I hope that this article helped you learn something new today. If it did you can follow me on Twitter, to stay connected.

Top comments (2)

Collapse
 
prerana1821 profile image
Prerana Nawar

Great Article!! Simple and Short! Understood what is component based is react from it. Thank you.

Collapse
 
amansethi00 profile image
Aman Sethi

Thank You for the feedback.