Nekode
React

Intro to React

Learn React from knowing what is React? why should I learn React? and How the story of React was created

Rifki ahmad fahrezi

Rifki ahmad fahrezi

What is React?

React is a JavaScript library for build dynamic and interactive UI (user interface), React developed and maintained by Facebook. React gains so many popularity due to its efficient rendering techniquesreusable components, and active community support.

React basic concepts

1. JSX (Javascript XML)

JSX is a syntax extension for React, JSX allows developers to write HTML elements in Javascript, using JSX in react is not mandatory, but using JSX it will make the development process alot easier in read and writing codes.

// Using JSX
const ele = <h1>This is sample JSX</h1>;
 
// Using plain JavaScript
const ele = React.createElement('h1', null, 'This is sample JSX');

2. Component

Component are independent reusable bits of code. They serve the same purpose like a function, but instead of returning value like number or boolean component returning HTML element.

In React you can create a component using two methods, using class component and using functional component, here is an example of creating component using class component and functional component.

Example class component

import React from 'react'
 
class Hello extends React.Component {  
		render() {
		    return <h1>Hello Nekode!</h1>;  
		}
}

Example function component

import React from 'react'
 
function Hello(){
	return (
		<h1>Hello Nekode!</h1>
	)
}

3. State

State is a JavaScript object that holds data that can be used to influence the rendering of a component. In simple terms, think of it as any piece of information that can change over time and impact how your component appears or behaves.

The state allows developers to create dynamic and interactive UIs by enabling components to respond to user input, API responses, or other events.

4. Virtual DOM

React uses Virtual DOM to optimize updates on web page, So every object that exists in the original DOM will have the copy of the object in React Virtual DOM, DOM and Virtual DOM is the same, but it does not have the power to directly change the layout of the document.

How virtual DOM works is basically everything in React is component, and component can contain a State, so every time the state change occurs , the virtual DOM is updated first, this update is happen super quick because doesn't involve direct interaction with the user interface.

React will only update a component if the state changes with “diffing” algorithm by comparing the new virtual DOM and the previous version.

/react/what-is-react/1_sWfjl94Bnshi1kewFCL0gg.webp

Story of React

React is developed by Facebook and its often used to building dynamic and interactive Single Page Application. React was released in 2013 since then, React is currently become one of the most popular javascript libraries to build UI (User Interface). React was developed by Jordan Walke, a software engineer at Facebook, and was initially released as an open-source project on GitHub.

React currently has been widely adopted by the developers community so there are so many third party libraries or even framework created for React, In addition, Facebook also released React Native, which allows developers to build native mobile applications using React.

Why should I Learn React in 2025

As you know React is one of the most popular javascript libraries to build a UI (User Interface), have so big developers community support, So here is some reason why you should learn React in 2025:

1. Simple prerequisites

If you want to learn React, you don’t have to learn so many programming languages or have alot of experiences. What you need is only solid foundation and knowledge of using HTML, CSS and Javascript

2. Huge React Communities

React is one of the most popular Javascript libraries, so there is no problem if you need somebody to ask or help you with your errors, React has a huge communities online and offline just search on your social media like Facebook, X or LinkedIn there must be a community for React developers with huge amount of members.

3. React can power any app

If you learn React you not only can build a website, you can also build a mobile app using React Native or even a desktop app powered by electron.

4. Pay Scale

Off course, salary is important. There is thousands of companies uses React for their application, this will make React developers also have thousands of jobs in the world required React skills.

According to glassdoor.com here is React developers salary for beginners in USA is around 86K to 160K USD per year.

Check it out

/react/what-is-react/image.png

Sources

https://www.geeksforgeeks.org/reactjs-introduction/

https://v1.scrimba.com/articles/why-use-react/

https://www.glassdoor.com/Salaries/react-developer-salary-SRCH_KO0,15.htm

On this page