React Lab Notes
React Lab Notes
This will set up a new React project in a folder called my-dynamic-app. After the installation is
complete, navigate to the project directory:
cd my-dynamic-app
import './[Link]';
function App() {
setText([Link]);
};
return (
<div className="App">
<input
type="text"
value={text}
onChange={handleChange}
placeholder="Type something..."
/>
</div>
);
npm start
This will open the app in your default web browser, typically at [Link] and you should
see an input field where you can type, and the content will update dynamically as you type.
OUTPUT:
Program 2
Step 1: Create a New React Application
First, you need to create a new React app using below
command. Open your terminal and run:
npx create-react-app react-props-demo
This will set up a new React project in a folder
called react-props-demo. After the installation is
complete, navigate to the project directory:
cd react-props-demo
Step 2: Define the Components
1. App Component (Parent Component)
In src/[Link], we define the parent component App,
which will pass data to the child components using
props.
import React from 'react';
import Header from './Header';
import Footer from './Footer';
import './[Link]';
function App() {
const title = "Welcome to My React App";
const tagline = "Building great apps with React";
const copyright = "© 2025 MyApp, All Rights
Reserved";
return (
<div className="App">
<Header title={title} />
<Footer tagline={tagline} copyright={copyright} />
</div>
);
}
function Header(props) {
return (
<header>
<h1>{[Link]}</h1>
</header>
);
}
function Footer(props) {
return (
<footer>
<p>{[Link]}</p>
<p>{[Link]}</p>
</footer>
);
}
header {
background-color: #282c34;
padding: 20px;
color: white;
}
footer {
background-color: #282c34;
padding: 10px;
color: white;
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
}
Step 4: Run the application
Back in your terminal, start the development server
by running:
npm start
OUTPUT:
Program 3
Step 1: Create a new React app
First, you need to create a new React app using below
command. Open your terminal and run:
npx create-react-app counter-app
This will set up a new React project in a folder
called counter-app. After the installation is complete,
navigate to the project directory:
cd counter-app
Step 2: Modify the [Link] File
1. Navigate to the src folder in the file explorer on the
left-hand side of VSCode.
2. Open the [Link] file (which contains the default
template code).
3. Replace the content of [Link] with the code
provided for the Counter App. Here’s the code to
replace inside [Link]:
import React, { useState } from 'react';
import './[Link]';
function App() {
const [counter, setCounter] = useState(0);
const [step, setStep] = useState(1);
const minValue = 0;
return (
<div style={{ textAlign: 'center', marginTop: '50px' }}>
<h1>Counter Application</h1>
<div style={{ fontSize: '48px', margin: '20px' }}>
<span>{counter}</span>
</div>
<div>
<button onClick={handleIncrement}>Increase by
{step}</button>
<button onClick={handleDecrement}>Decrease by
{step}</button>
<button onClick={handleReset}>Reset</button>
</div>
button {
margin: 10px;
padding: 10px;
font-size: 16px;
cursor: pointer;
}
input {
padding: 5px;
font-size: 16px;
}
You can also remove any default styling from
the [Link] file that is not needed for this project.
Step 4: Start the Development Server
1. In the terminal inside VSCode, run the following
command to start the React development
npm start
This will open your browser and navigate
to [Link] You should see your
Counter Application up and running.
OUTPUT:
Program 4:
Step 1: Create a New React Application
First, you need to create a new React app using below
command. Open your terminal and run:
npx create-react-app todo-app
This will set up a new React project in a folder
called todo-app. After the installation is complete,
navigate to the project directory:
cd todo-app
Step 2: Modify the [Link] File
1. Navigate to the src folder in the file explorer on
the left-hand side of VSCode.
2. Open the [Link] file (which contains the default
template code).
3. Replace the content of [Link] with the code
provided for the todo-app. Here’s the code to
replace inside [Link]:
import React, { useState } from 'react';
import './[Link]';
return (
<div className="todo-container">
<h2 className="todo-header">To-Do List</h2>
<div className="todo-input-wrapper">
<input
type="text"
value={newTask}
onChange={(e) => setNewTask([Link])}
placeholder="Add a new task..."
className="todo-input"
/>
<button className="add-task-button"
onClick={addTask}>Add Task</button>
</div>
<ul className="todo-list">
{[Link]((task) => (
<li
key={[Link]}
className={`todo-item ${[Link] ?
'completed' : ''}`}
>
<span
className="task-text"
onClick={() => toggleTaskCompletion([Link])}
>
{[Link]}
</span>
<button
className="delete-button"
onClick={() => deleteTask([Link])}
>
❌
</button>
</li>
))}
</ul>
</div>
);
};
export default ToDoFunction;
Step 3: Modify the [Link] (Optional)
You can adjust the styling if desired. For example, you
can modify [Link] to ensure the buttons look good:
.todo-container {
font-family: 'Arial', sans-serif;
max-width: 500px;
margin: 50px auto;
padding: 20px;
border: 1px solid #e0e0e0;
border-radius: 8px;
background-color: #f9f9f9;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
.todo-header {
color: #4A90E2;
font-size: 2rem;
margin-bottom: 20px;
}
.todo-input-wrapper {
display: flex;
justify-content: center;
margin-bottom: 20px;
}
.todo-input {
width: 70%;
padding: 10px;
border-radius: 4px;
border: 1px solid #ccc;
font-size: 1rem;
outline: none;
}
.add-task-button {
padding: 10px 15px;
margin-left: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s;
}
.add-task-button:hover {
background-color: #45a049;
}
.todo-list {
list-style-type: none;
padding-left: 0;
margin: 0;
}
.todo-item {
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
padding: 12px;
margin: 10px 0;
border-radius: 5px;
border: 1px solid #ddd;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: transform 0.2s ease-in-out;
}
.todo-item:hover {
transform: scale(1.03);
}
.[Link] {
background-color: #f1f1f1;
text-decoration: line-through;
color: #aaa;
}
.task-text {
cursor: pointer;
font-size: 1.1rem;
color: #333;
transition: color 0.3s;
}
.task-text:hover {
color: #4CAF50;
}
.delete-button {
background: none;
border: none;
font-size: 1.1rem;
color: #ff6347;
cursor: pointer;
transition: color 0.3s;
}
.delete-button:hover {
color: #ff4500;
}
You can also remove any default styling from
the [Link] file that is not needed for this project.
Step 4: Start the Development Server
1. In the terminal inside VSCode, run the following
command to start the React development
npm start
This will open your browser and navigate
to [Link] You should see your
Counter Application up and running.
OUTPUT:
Program 5
Step 1: Create a New React Application
First, you need to create a new React app using below
command. Open your terminal and run:
npx create-react-app figure-gallery
This will set up a new React project in a folder
called figure-gallery. After the installation is complete,
navigate to the project directory:
cd figure-gallery
Step 2: Set Up the Folder Structure
Create the folder structure. Here’s how you can
organize the directories:
1. Inside the src folder:
Create a components folder.
Inside components, create [Link] and
[Link].
[Link]:
// [Link]
import React from 'react';
return (
<div className="figure-list-container">
<div className='button-box'>
<button onClick={addFigure}
className="action-button">Add Image</button>
<button onClick={removeFigure}
className="action-button">Remove Image</button>
</div>
<div className="figure-list">
{[Link]((figure, index) => (
<BasicFigure key={index}
imageUrl={[Link]} caption={[Link]} />
))}
</div>
</div>
);
};
.figure-list-container {
display: flex;
flex-direction: column;
align-items: center;
margin: 20px;
}
.button-box {
display: block;
text-align: center;
padding: 10px;
margin-bottom: 20px;
}
.action-button {
padding: 10px 20px;
margin: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
.action-button:hover {
background-color: #45a049;
}
.figure-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 15px;
}
.figure-list img {
max-width: 200px;
max-height: 200px;
border: 2px solid #ccc;
border-radius: 8px;
}
figure {
display: flex;
flex-direction: column;
align-items: center;
}
figcaption {
margin-top: 8px;
font-size: 14px;
color: #555;
}
.figure {
display: flex;
flex-direction: column;
align-items: center;
border: 2px solid #ddd;
border-radius: 8px;
padding: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.figure:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.figure-image {
max-width: 200px;
max-height: 200px;
border-radius: 8px;
object-fit: cover;
}
.figure-caption {
margin-top: 10px;
font-size: 14px;
color: #555;
text-align: center;
}
Step 5: Run the application
Back in your terminal, start the development server by
running:
npm start
OUTPUT:
Program 6
if (![Link]) {
[Link] = 'Name is required.';
isValid = false;
}
if (![Link]) {
[Link] = 'Password is required.';
isValid = false;
} else if ([Link] < 6) {
[Link] = 'Password must be at least 6
characters long.';
isValid = false;
}
setErrors(newErrors);
setIsFormValid(isValid);
}, [formData]);
useEffect(() => {
validateForm();
}, [formData, validateForm]);
if (isFormValid) {
[Link]('Form Data:', formData);
setFormData({
name: '',
email: '',
password: '',
});
}
};
return (
<div className="form-container">
<h2 className="form-title">Registration Form</h2>
<form onSubmit={handleSubmit} className="form">
<div className="form-group">
<label htmlFor="name" className="form-
label">Name</label>
<input
type="text"
id="name"
name="name"
value={[Link]}
onChange={handleChange}
className={`form-input ${[Link] ? 'error' :
''}`}
placeholder="Enter your name"
/>
{[Link] && <div className="error-
message">{[Link]}</div>}
</div>
<div className="form-group">
<label htmlFor="email" className="form-
label">Email</label>
<input
type="email"
id="email"
name="email"
value={[Link]}
onChange={handleChange}
className={`form-input ${[Link] ? 'error' :
''}`}
placeholder="Enter your email"
/>
{[Link] && <div className="error-
message">{[Link]}</div>}
</div>
<div className="form-group">
<label htmlFor="password" className="form-
label">Password</label>
<input
type={showPassword ? 'text' : 'password'}
id="password"
name="password"
value={[Link]}
onChange={handleChange}
className={`form-input ${[Link] ? 'error' :
''}`}
placeholder="Enter your password"
/>
{[Link] && <div className="error-
message">{[Link]}</div>}
</div>
<div className="form-group">
<button type="submit" className="form-submit"
disabled={!isFormValid}>
Submit
</button>
</div>
</form>
</div>
);
};
function App() {
return (
<div className="App">
<Form />
</div>
);
}
.form-title {
text-align: center;
font-size: 24px;
margin-bottom: 20px;
color: #333;
}
.form {
display: flex;
flex-direction: column;
}
.form-group {
margin-bottom: 15px;
}
.form-label {
font-size: 14px;
font-weight: 600;
color: #555;
}
.form-input {
width: 100%;
padding: 12px;
margin-top: 5px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
.[Link] {
border-color: red;
}
.error-message {
color: red;
font-size: 12px;
margin-top: 5px;
}
.password-toggle {
margin-bottom: 20px;
}
.form-submit {
padding: 12px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}
.form-submit:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.form-submit:hover:not(:disabled) {
background-color: #45a049;
}
Step 5: Run the application
Back in your terminal, start the development server by
running:
npm start
OUTPUT:
Program 7
step 1: Create a New React Application
First, you need to create a new React app using below
command. Open your terminal and run:
npx create-react-app profile-card-app
This will set up a new React project in a folder called profile-
card-app. After the installation is complete, navigate to the
project directory:
cd profile-card-app
Step 2: Set Up the Folder Structure
Inside the src folder, create a new
file [Link] to define the ProfileCard component.
After that copy and paste below code in
the [Link] file.
[Link]:
import React, { useState } from 'react';
return (
<div
className="profile-card"
style={{ backgroundColor: bgColor }}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
<img
src={profilePicture}
alt={`${name}'s profile`}
className="profile-picture"
/>
<div className="profile-info">
<h2 className="profile-name">{name}</h2>
<p className="profile-bio">{bio}</p>
</div>
</div>
);
};
profilePicture="[Link]
4/11/cropped-vtucircle_icon-[Link]"
/>
</div>
);
};
.profile-card-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
width: 100%;
}
.profile-card:hover {
transform: translateY(-10px);
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
background-color: #f3f4f6;
}
.profile-picture {
width: 130px;
height: 130px;
border-radius: 50%;
object-fit: cover;
border: 4px solid #fff;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.profile-card:hover .profile-picture {
transform: scale(1.1);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.profile-info {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-
serif;
}
.profile-name {
font-size: 1.8rem;
font-weight: 600;
color: #333;
margin-bottom: 15px;
transition: color 0.3s ease;
}
.profile-card:hover .profile-name {
color: #5e35b1;
}
.profile-bio {
font-size: 1.1rem;
color: #555;
line-height: 1.5;
margin-bottom: 0;
transition: color 0.3s ease;
}
.profile-card:hover .profile-bio {
color: #444;
}
.profile-card-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
width: 100%;
background-color: #f4f7fa;
}
Step 4: Start the Development Server
1. In the terminal inside VSCode, run the following
command to start the React development.
npm start
This will open your browser and navigate
to [Link] You should see
your ProfileCard application up and running.
Program 8
Step 1: Create a New React Application
First, you need to create a new React app using below
command. Open your terminal and run:
npx create-react-app react-reminder-app
This will set up a new React project in a folder called react-
reminder-app. After the installation is complete, navigate to
the project directory:
cd react-reminder-app
Step 2: Set Up the Folder Structure
Create the folder structure. Here’s how you can organize the
directories:
1. Inside the src folder:
Create a components folder.
Inside components, create [Link] , [Link]
and [Link] files. Copy below code and paste it
into the different files.
[Link]:
import React, { useState } from 'react';
return (
<form onSubmit={handleSubmit}>
<div>
<input
type="text"
placeholder="Task Name"
value={taskName}
onChange={(e) => setTaskName([Link])}
/>
</div>
<div>
<input
type="date"
value={dueDate}
onChange={(e) => setDueDate([Link])}
/>
</div>
<div>
<textarea
placeholder="Description (optional)"
value={description}
onChange={(e) => setDescription([Link])}
/>
</div>
<button type="submit">Add Task</button>
</form>
);
}
return (
<div>
{[Link] > 0 ? (
<ul>
{[Link]((task) => (
<li key={[Link]}>
<h3>{[Link]}</h3>
<p>Due Date: {[Link]}</p>
{[Link] && <p>Description:
{[Link]}</p>}
<p>Status: {[Link] ? 'Completed' : 'Not
Completed'}</p>
<button onClick={() =>
toggleTaskCompletion([Link])}>
{[Link] ? 'Mark as Not Completed' : 'Mark
as Completed'}
</button>
<button onClick={() =>
deleteTask([Link])}>Delete</button>
</li>
))}
</ul>
):(
<p>No tasks available!</p>
)}
</div>
);
}
function App() {
const [tasks, setTasks] = useState([]);
const [filter, setFilter] = useState('all');
return (
<div className="App">
<h1>Task Reminder</h1>
<TaskForm addTask={addTask} />
<Filter setFilter={handleFilterChange} />
<TaskList tasks={filteredTasks} setTasks={setTasks} />
</div>
);
}
.App {
width: 550px;
padding: 30px;
background-color: #ffffff;
border-radius: 12px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.App:hover {
transform: translateY(-5px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
h1 {
font-size: 2.2rem;
color: #333;
text-align: center;
margin-bottom: 10px;
margin-top: 0;
}
form {
display: flex;
flex-direction: column;
gap: 20px;
}
input,
textarea {
padding: 12px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 8px;
transition: border-color 0.3s ease;
}
input:focus,
textarea:focus {
border-color: #4CAF50;
outline: none;
}
button {
background-color: #4CAF50;
color: white;
border: none;
padding: 12px;
font-size: 1rem;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
}
button:hover {
background-color: #45a049;
}
button:active {
transform: scale(0.98);
}
textarea {
resize: vertical;
min-height: 120px;
}
input[type="date"] {
padding: 12px;
}
div {
display: flex;
flex-direction: column;
gap: 10px;
}
ul {
list-style-type: none;
padding: 0;
}
li {
background-color: #fafafa;
margin: 15px 0;
padding: 20px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
li:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
h3 {
margin: 0;
font-size: 1.5rem;
color: #333;
font-weight: 600;
}
p{
margin: 5px 0;
color: #666;
}
button {
background-color: #007BFF;
color: white;
border: none;
padding: 8px 15px;
font-size: 1rem;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
margin-right: 10px;
}
button:hover {
background-color: #0056b3;
}
button:active {
background-color: #003f8d;
}
button:last-child {
background-color: #e74c3c;
}
button:last-child:hover {
background-color: #c0392b;
}
button:last-child:active {
background-color: #7f1c1c;
}
.completed {
text-decoration: line-through;
color: #bbb;
}
div {
display: flex;
gap: 20px;
justify-content: center;
}
button {
background-color: #f1f1f1;
color: #333;
padding: 12px 18px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
}
button:hover {
background-color: #ddd;
}
button:active {
transform: scale(0.98);
}
button:focus {
outline: none;
border-color: #007BFF;
}
Step 5: Run the application
1. In the terminal inside VSCode, run the following
command to start the React development.
npm start
This will open your browser and navigate
to [Link] You should see
your task reminder application up and running.
OUTPUT:
Program 9
Step 1: Create a New React Application
First, you need to create a new React app using below
command. Open your terminal and run:
npx create-react-app my-routing-app
This will set up a new React project in a folder called my-
routing-app. After the installation is complete, navigate to
the project directory:
cd my-routing-app
Step 2: Install react-router-dom
1. In the terminal inside VSCode, install react-router-dom:
npm install react-router-dom
Step 3: Set Up the Folder Structure
Create the folder structure. Here’s how you can organize the
directories:
1. Inside the src folder:
Create a components folder.
Inside components, create [Link] , [Link], Co
[Link] and [Link] files. Copy below code and
paste it into the different files.
[Link]:
import React from 'react';
div {
margin: 0 auto;
max-width: 960px;
padding: 20px;
}
h2 {
color: #333;
padding-bottom: 20px;
}
nav {
background-color: #333;
padding: 10px;
border-radius: 5px;
margin-bottom: 20px;
}
ul {
list-style: none;
display: flex;
gap: 15px;
justify-content: center;
margin: 0;
padding: 0;
}
li {
display: inline;
}
a{
text-decoration: none;
color: white;
padding: 8px 16px;
border-radius: 4px;
}
a:hover {
background-color: #444;
}
[Link] {
background-color: #1e90ff;
color: white;
font-weight: bold;
}
p{
color: #555;
font-size: 1.1rem;
line-height: 1.6;
}
Step 6: Set Up the Entry Point ([Link])
1. Open src/[Link] and ensure the entry point is correct:
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
[Link](<App />);
Step 7: Run the App
1. Now that you’ve set up everything, go back to your
terminal and run:
npm start
This will start your React app, and it should
automatically open in your default browser
at [Link]
OUTPUT:
Program 10
Step 1: Create a New React Application
First, you need to create a new React app using
below command. Open your terminal and run:
npx create-react-app data-fetcher
This will set up a new React project in a folder
called data-fetcher. After the installation is complete,
navigate to the project directory:
cd data-fetcher
Step 2: Update src/[Link]:
Navigate to the src folder in the file explorer on
the left-hand side of VSCode.
Open the [Link] file (which contains the default
template code).
Replace the content of [Link] with the code
provided for the data-fetcher. Here’s the code to
replace inside [Link]:
import React, { Component } from 'react';
const API_URL =
'[Link]
componentDidMount() {
[Link]();
}
componentDidUpdate(prevProps, prevState) {
if ([Link] !==
[Link]) {
[Link]();
}
}
filterData = () => {
const { data, searchQuery } = [Link];
if ([Link]() === '') {
[Link]({ filteredData: data });
} else {
const filteredData = [Link]((item) =>
[Link]().includes([Link]
erCase())
);
[Link]({ filteredData });
}
};
renderError = () => {
const { error } = [Link];
return error ? <div className="error">{`Error: $
{error}`}</div> : null;
};
render() {
const { filteredData, searchQuery, loading } =
[Link];
return (
<div className="data-fetcher">
<h1>User Data</h1>
{[Link]()}
<div className="search-bar">
<input
type="text"
value={searchQuery}
onChange={[Link]}
placeholder="Search by name"
/>
</div>
{loading ? (
<div>Loading...</div>
):(
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>City</th>
</tr>
</thead>
<tbody>
{[Link] > 0 ? (
[Link]((item) => (
<tr key={[Link]}>
<td>{[Link]}</td>
<td>{[Link]}</td>
<td>{[Link]}</td>
</tr>
))
):(
<tr>
<td colSpan="3">No results found.</td>
</tr>
)}
</tbody>
</table>
)}
<button onClick={[Link]}>Refresh
Data</button>
</div>
);
}
}
export default DataFetcher;
Step 3: Update src/[Link]:
Replace the default content of src/[Link] with
this code to ensure the component is rendered in
your application:
import React from 'react';
import ReactDOM from 'react-dom/client';
import './[Link]';
import DataFetcher from './App';
const root =
[Link]([Link]('root
'));
[Link](
<[Link]>
<DataFetcher />
</[Link]>
);
Step 4: Modify the [Link]
You can adjust the styling if desired. For example,
you can modify [Link] to ensure the UI look
good:
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
button {
border-radius: 5px;
border: none;
cursor: pointer;
color: #fff;
font-weight: bold;
background: red;
margin-top: 20px;
padding: 10px;
}
.data-fetcher {
width: 80%;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
.search-bar {
margin: 20px 0;
text-align: center;
}
.search-bar input {
padding: 8px;
width: 60%;
font-size: 16px;
border: 1px solid #000;
border-radius: 4px;
}
table {
width: 100%;
margin-top: 20px;
border-collapse: collapse;
}
table th,
table td {
padding: 10px;
text-align: left;
border-bottom: 1px solid #ddd;
}
.error {
color: red;
text-align: center;
}
Step 5: Start the Development Server
1. In the terminal inside VSCode, run the following
command to start the React development.
npm start
This will open your browser and navigate
to [Link] You should see your
Counter Application up and running.
OUTPUT: