Creating ReactJS with Vite
Creating ReactJS with Vite
ReactJS
- What is React
- How React Works
- React Ecosystem
Basic Structure
Component
Forms
Backend Integration
Router
Questions:
1. Where will we define custom CSS? Considered option, A. Create separate css file per
component. B. Add all new classes in index.css and treat it as a global
2.
Creating a React Application
Before to create a React application, make sure NodeJS version 16 and above is installed in your
machine.
There are several ways to create a React project. We will use Vite in this exercise. To use Vite,
type the code below and press enter.
Type ‘y’ if asked to proceed. Now, add the name of the project.
? Select a framework:
Vanilla
Vue
React
Lit
Svelte
Others
? Select a variant:
JavaScript
TypeScript
JavaScript + SWC
TypeScript + SWC
Now go inside your project directory by typing cd slf-client-app and press enter. To install
dependencies, use the command npm install in your terminal. To check the project
completely working, type npm run dev and press enter.
To see the project structure, type code . in your terminal then press enter to open VSCode.
Reusable React Components Structure
A React component is an element of the user interface (UI) that has its own logic and
appearance. A component can range in size from a button to a whole page.
Exercise
In this exercise you will create a bootstrap button component. The objective is to encapsulate
the bootstrap markup into a reusable React button component.
Solution
<in-progress>
<in-progress>