React
What is React?
A JS library for building user interfaces
- is known for its efficiency and flexibility in creating interactive and reusable UI components
- The main idea behind React is tobreak down the user interface into small, isolated components.
( Component : A codeset that writes code for structure and operation as a bundle )
- Each component represents a part of the UI and can have its own state and properties.
- These components can be combined to build complex UI structures.
Why shoud we use React?
Using just JS isn't a great option
- cumbersome
- error-prone
- hard to edit / maintain
By using React,
- high speed (Virtual DOM)
- reusable and clearer web components
Features of React
1) Declarative
Aims for declarative programming
that does not divide html/css/js,
but uses JSX to explicitly write in one file
2) Component-based
Separation into each component for one function
- The top-level component is the root and has child components
- Hierarchy: Shaped as a tree structure
- - Create and combine multiple components to create applications
- Independence Possible to develop by focusing on the function itself
- Reusability Maintenance, Unit testing
3) Versatility
- Flexible application to any JS project
- Managed by facebook -> Stable
- Mobile development is possible with React Native
Create React App
- A tool chain designed to make developing SPA easy and fast
- Even if you don't know how all the tools work, it helps you to set up complex development in advance
Creating a React app using npm
[terminal]
npx create-react-app project_name
[e.g.]
npx create-react- app MyFirstReact
How to run a React app
[terminal]
npm run start

Top comments (0)