DEV Community

mohandass
mohandass

Posted on

What is React.js

1. What is React j.s
React is a free and open source JavaScript library. It's used for Building user interfaces(UIs) specifically for single-page Applications(SPA). Created by Facebook(now meta) in 2013,it's allows Developers create large web application that can change data without Reloading the page.

React helps developers create:

  • Websites
  • Single Page Applications (SPA)
  • Dashboards
  • E-commerce apps
  • Social media apps
  • Mobile apps (with React Native)

Why React was Created

  • React was created to solve problems developers faced while building larger and dynamic web applications.

Before React, developers updated HTML manually using JavaScript.

Example:
document.getElementById("title").innerHTML = "welcome";

When the application become larger:

  • Code became messy
  • Updating UI became difficult
  • Performance issues happened

React solving this by introducing :

Components,Virtual DOM,State management,Reusable UI

2. What is the different between library and Framework ?

  • The primary difference between a library and a framework is Inversion of Control(IOC) in short, When you use a library, your are the in charge; When you use a framework, the framework is in charge.

Use a library when:

  • You need flexibility
  • Small project
  • Specific feature only
  • Want custom architecture

Use a framework when:

  • Building large applications
  • Need standard structure
  • Team collaboration
  • Faster large-scale development

Simple Concept

Library = Helper-(It helps your code)

Framework = Foundation-(Your app runs inside it)

3. What is Build Tool

  • A build tool is a software utility that automates the process of converting source code.which typically includes JSX, modern JavaScript (ES6+), and CSS—into a optimized, production-ready format that web browsers can understand

Why Build Tools Are Needed

Modern web applications use:

  • Multiple files
  • React components
  • TypeScript
  • SCSS
  • Images
  • APIs
  • Modules

Browsers cannot directly understand everything.

For example:

-Browsers do not understand JSX directly
-Browsers do not understand TypeScript directly

Build tools convert them into normal JavaScript, HTML, and CSS.

Common Examples by Language

  1. Java - Apache Maven, Gradle

  2. JavaScript - npm,webpack,vite

  3. C/C++ - Make, CMake

  4. Python - Poetry, pip

4. What is vite

  • Vite (pronounced “veet”) is a modern frontend build tool used to create fast web applications.It offers instant server startup and lightning-fast Hot Module Replacement (HMR), making it a popular replacement for tools like Create React App.

Why Vite Was Created

Older build tools like:

Webpack

became slow for large applications.

Problems:

-Slow startup
-Slow rebuilds
-Slow hot reload

Vite was created to solve these speed problems.

Vite helps developers:

-Start projects quickly
-Run development servers
-Bundle files
-Optimize applications

Top comments (0)