React Introduction

Photo by Ferenc Almasi on Unsplash

React is a JavaScript library developed for front-end management. It is a complete mixture of HTML,CSS and JS.

To create react projects, follow instructions mentioned on React’s official doc.

React is popular because it comes with in-built virtual DOM which puts lesser load on browser and also it is easy to learn. React uses JSX(JavaScript XML) for component creation.

To use React and it’s virtual DOM, the modules need to be imported in the following :

import React from ‘react’;
import ReactDOM from 'react-dom';

To render something using ReactDOM:

ReactDOM.render(<div><h1>Hello World</h1><p>Content</p></div>,

NOTE: only single HTML tag is allowed in render function. Therefore, two tags were included inside one parent div tag.

To add JavaScript syntax within HTML tags in render() which uses JSX, { } are used. Example:

let content = "Hello, World";
ReactDOM.render(<h1>{content}</h1>, document.getElementById("root"));

NOTE: only expressions can be used inside curly braces. Statement can’t be added inside render(). Therefore conditions checking and iterations can’t be done directly inside render function.

Sample React project can be found here.




Learner. Observer. Interested in software development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top 3 Must-have Visual Studio Code Extensions For Every React Developer.

Android WebView: Making changes on UI appearance

Jest: Passing custom arguments

I Almost Got My Teammates Fired

men worrying, with the ocean in the background

“Places2Go” and the MEAN Stack(I)

Sorting with multiple conditions in TypeScript

JavaScript ‘this’ keyword: A beginner’s approach

Part 2: GCP DialogFlow Voice Chat Tracking Using Adobe Analytics [Part 2/2]

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akanksha Pardeshi

Akanksha Pardeshi

Learner. Observer. Interested in software development.

More from Medium

React JS

Create Multiple env’s for your React application.