react-master-guide

React Master Guide

What Is React ?

A JavaScript library for building user interfaces πŸ† it is declarative

Setup React App On Local Machine

Install Node First https://nodejs.org/en/

Basic of node and npm

node and npm command list and version

setup react app using vite (Next Generation Frontend Tooling)

npm create vite@latest : create template
cd tech-unit 
npm install  // install react package
npm run dev  // to run the code

JSX

JSX (JavaScript XML) is a syntax extension used in React to describe the structure of user interface components in a more concise and intuitive way. It allows you to write HTML-like code directly in your JavaScript files, which is then transformed into JavaScript objects by the transpiler (such as Babel) before it’s run by the browser.

const element = React.createElement(
  'h1',
  { className: 'greeting' },
  'Hello, world!'
);

You can write the same thing using JSX like this:

const element = <h1 className="greeting">Hello, world!</h1>;