What is React and its purpose?
React is a Javascript library and its ultimate purpose is to show content (HTML) to users and handle user interaction.
Why don't we use Redux to make all the apps?
React can work by itself. But it can also work with a tremendous variety of other libraries, packages, servers and databases.
What is class in React
A class that we use in React is a JavaSsript class
. React components
are made using either Javascript functions or classes.
What is the HTML looking stuff in React?
It is JSX (a special dialect of Javascript). It lools like HTML and can be placed in Javascript code. It dtermines the content of our React app just like normal HTML.
What are two libraries Reat and ReactDOM
React is split into two separate libraries
React
knows what is component is and how to make components work togetherReactDOM
knows how to take a component and make it show up in the DOM
Steps to create a React Application |
---|
Install/Update Node JS |
↓ |
Install create-react-app |
↓ |
Generate a project |
↓ |
Build Project |
Note: After installing node, we might have to to restart our terminal to get node -v
to work.
To use create-react-app
, one needs to run following command
npx create-react-app app-name
- This does also install many behind the libraries like webpack, babel and dev server, which we don't need to setup.