Web apps are becoming increasingly complex and dynamic. In response, new tools and libraries like React have been created to speed up the process.

But how is web app development with React different than developing an app with just plain JavaScript?

What is ‘plain’ JavaScript?

It’s important to point out that React itself is written in JavaScript, which could lead one to think that writing React is just writing JavaScript code.

To set some boundaries, let’s first define what we mean by “plain” JavaScript (also called “vanilla” JavaScript).

React is a library that defines the way apps are written. It does this by setting very clear rules about how data can flow through the app, and how the UI will adapt as a result of that changing data. There are other libraries that set similar boundaries, such as Angular and Vue.

Plain JavaScript code (that is, JavaScript written without libraries) on the other hand, can be thought of as a scripting language that doesn’t set any rules about how data can be defined, or how the UI can be changed. That makes apps written without these libraries more freeform and customizable. But going this route can also lead to problems down the road.

The one library that we could be included under the umbrella of “plain JavaScript” would be jQuery. jQuery is a convenient wrapper that goes around existing JavaScript functionality to make it easy and consistent to use across browsers. It doesn’t set the same boundaries as a library like React though—so a jQuery app could fall into the same trap as apps written in plain JS.

#javascript #reactjs #web-development

React vs. Plain JavaScript
17.80 GEEK