WHAT IS REACTJS?
React is a JavaScript library for building fast interactive user interfaces
WHY LEARN REACTJS?
- React is the most popular java script library
- There’s a ton of learning resources for ReactJS.
- You can easily integrate React components into legacy code.
- Components can be reused and can be nested for easy application composition.
- The Virtual DOM is extremely efficient at rendering web applications
- It allows complex UIs to be composed from small and isolated
pieces of code called “components.”
NOW LETS CREATE A SIMPLE REACTJS!
Note: I suppose you’ve already set up a NodeJS environment.
Let’s install or update the latest version of npm first.
STEP : 1
First, we’re going to install a tool, Create React App, that will allow us to create our first React project, Open up your working directory in terminal and use the commands as follows:
>>mkdir titan_React_demo
>>npm i -g create-react-app ( create-react-app node package sets up the React project )
STEP : 2
Create your project
Navigate to the root directory of your project and create a new React
project:
>>npx create-react-app first-react-app
STEP: 3
Awesome, you can start your project now
>>cd titan_React_demo
>>npm start
Your default browser should launch automatically, and you should get a screen like this:
