React Js
React Js
A
Seminar
submitted
in partial fulfillment
for the award of the Degree of
Bachelor of Technology
in Department of Computer Science & Engineering
(with specialization in Computer Science & Engineering)
This is to certify that Mr. Vishnu Banjara, a student of B.Tech (Computer Science &
Engineering) 7th semester has been submitted his Seminar Training report entitled “React
Js” under my guidance.
i
ACKNOWLEDGEMENT
I feel immense pleasure in expressing my regards to the chairman Mr. Suraj Ram Meel,
DirectorMr. Jaipal Meel, Registrar Mrs. Rachana Meel, Director (Academics) Prof. (Dr.)
S.L. Surana,Principle Prof. (Dr) Ramesh Kumar Pachar, Swami Keshvanand Institute of
Technology, Management & Gramothan, Jaipur for providing me necessary facilities during
the various stagesof this work.
I would like to thank Dr Mukesh Kumar Gupta, Professor & Head, Department of
Computer Science & Engineering and Dr Anil Chaudhary, Professor & Head, Department
of Information Technology for providing me opportunity to work in a consistent direction
and providing their valuable suggestions to improve Seminar Report.
I would like to express my thanks to my parents for their support and blessings. In addition,
a veryspecial thanks to all my colleagues and friends for their support in the completion of
this report.
ii
ABSTRACT
i
LIST OF CONTENT
ABSTRACT i
LIST OF FIGURES ii
1 INTRODUCTION 1
2 REACTJS INSTALLATION 5
2.3 Installation 6
3 BMI CALCULATOR APPLICATION USING 9
REACTJS
3.1 Objective 9
4.1 Result 12
4.4 Conclusion 17
4.5 Reference 18
LIST OF FIGURES
ii
LIST OF ABBREVATIONS
ABBREVATIONS EXPANSIONS
JS JavaScript
iii
CHAPTER 1
INTRODUCTION
1
1.1 REACTJS FEATURES
o JSX
o Components
o One-way Data Binding
o Virtual DOM
o Simplicity
o Performance
2
JSX
JSX stands for JavaScript XML. It is a JavaScript syntax extension. Its an XML
or HTML like syntax used by ReactJS. This syntax is processed into JavaScript
calls of React Framework. It extends the ES6 so that HTML like text can co-exist
with JavaScript react code. It is not necessary to use JSX, but it is recommended
to use in ReactJS.
Components
ReactJS is all about components. ReactJS application is made up of multiple
components, and each component has its own logic and controls. These
components can be reusable which help you to maintain the code when working
on larger scale projects.
Virtual DOM
A virtual DOM object is a representation of the original DOM object. It works
like a one-way data binding. Whenever any modifications happen in the web
application, the entire UI is re-rendered in virtual DOM representation. Then it
checks the difference between the previous DOM representation and new DOM.
Once it has done, the real DOM will update only the things that have actually
changed. This makes the application faster, and there is no wastage of memory.
Simplicity
ReactJS uses JSX file which makes the application simple and to code as well as
understand. We know that ReactJS is a component-based approach which makes
the code reusable as your need. This makes it simple to use and learn.
3
Performance
ReactJS is known to be a great performer. This feature makes it much better than
other frameworks out there today. The reason behind this is that it manages a
virtual DOM. The DOM is a cross-platform and programming API which deals
with HTML, XML or XHTML. The DOM exists entirely in memory. Due to this,
when we create a component, we did not write directly to the DOM. Instead, we
are writing virtual components that will turn into the DOM leading to smoother
and faster performance.
• Speed. ...
• Flexibility. ...
• Performance. ...
• Usability. ...
• Reusable Components. ...
• It's easy to learn. ...
• It helps to build rich user interfaces. ...
• It allows writing custom components.
4
CHAPTER – 2
REACTJS INSTALLATION
There are two ways to set up an environment for successful ReactJS application.
They are given below.
NodeJS and NPM package manager by the link given below NodeJS and NPM
are the platforms need to develop any ReactJS application. You can install.
▪ Node -v
▪ Npm -v
Create a root folder with the name reactApp on the desktop or where you want.
Here, we create it on the desktop. You can create the folder directly or using the
command given below.
Now, you need to create a package.json file. To create any module, it is required
to generate a package.json file in the project folder. To do this, you need to run
the following command.
➢ npm init -y
After creating a package.json file, you need to install react and its
DOM packages using the following npm command.
5
2.2 REACT CREATE – REACT – APP
REQUIRMENTS
The Create React App is maintained by Facebook and can works on any
platform, for example, macOS, Windows, Linux, etc. To create a React Project
using create-react-app, you need to have installed the following things in your
system.
Let us check the current version of Node and NPM in the system.
2.3 INSTALLATION
Install REACT
We can install React using npm package manager by using the following
command. There is no need to worry about the complexity of React installation.
The create-react-app npm package manager will manage everything, which
needed for React project.
6
The React project is created successfully on our system. Now, we need to start the
server so that we can access the application on the browser. Type the following
command in the terminal window.
1. $ cd Desktop
2. $ npm start
NPM is a package manager which starts the server and access the application at
default server http://localhost:3000.
Next, open the project on Code editor. Here, I am using Visual Studio Code. Our
project's default structure looks like as below image.
Requirements of Application:
7
Fig., 1.3 Explorer of react.
In React application, there are several files and folders in the root directory. Some
of them are as follows:
1. node_modules: It contains the React library and any other third party
libraries needed.
2. public: It holds the public assets of the application. It contains the
index.html where React will mount the application by default on the <div
id="root"></div> element.
3. src: It contains the App.css, App.js, App.test.js, index.css, index.js, and
serviceWorker.js files. Here, the App.js file always responsible for
displaying the output screen in React.
4. package-lock.json: It is generated automatically for any operations where
npm package modifies either the node_modules tree or package.json. It
cannot be published. It will be ignored if it finds any other place rather than
the top-level package.
5. package.json: It holds various metadata required for the project. It gives
information to npm, which allows to identify the project as well as handle
the project?s dependencies.
6. README.md: It provides the documentation to read about React topics.
8
CHAPTER – 3
3.1 OBJECTIVE
▪ BMI is a screening tool that can indicate whether a person is underweight
or if they have a healthy weight, excess weight, or obesity.
▪ Scope of the project is to find the variation of health between people.
BMI Categories
9
How to calculate BMI
To calculate BMI, you are required to have two values: a person's height in meters
and his weight in kilograms. If the height is in inches, weight should be in pounds.
The formula to calculate BMI is as follows:
Although BMI is a widely used and useful indicator of healthy body weight, it
does have its limitations. Due to a wide variety of body types as well as
distribution of muscle, bone mass, and fat, BMI should be considered along with
other measurements rather than being used as the sole method for determining a
person's healthy body weight.
In adults:
BMI cannot be fully accurate because it is a measure of excess body weight, rather
than excess body fat. BMI is further influenced by factors such as age, sex,
ethnicity, muscle mass, and body fat, and activity level, among others. For
example, an older person who is considered a healthy weight, but is completely
inactive in their daily life may have significant amounts of excess body fat even
though they are not heavy.
In children and adolescents:
The same factors that limit the efficacy of BMI for adults can also apply to
children and adolescents. Additionally, height and level of sexual maturation can
influence BMI and body fat among children. BMI is a better indicator of excess
body fat for obese children than it is for overweight children, whose BMI could
be a result of increased levels of either fat or fat-free mass (all body components
except for fat, which includes water, organs, muscle, etc.).
Add REACT components to get a input from the user and perform the require
BMI Operation.The final result is your BMI value.
10
STEPS TO FOLLOW
Based on your given inputs, It will calculate your BMI and displays it on the
screen.
BMI formula
Weight in kg
BMI =
11
CHAPTER - 4
4.1 RESULT
The package was created in such a way that future changes are simple to
implement. The following conclusions can be drawn from the project's progress.
The efficiency of the entire system is improved by automating it. It has a user-
friendly graphical user interface that outperforms the current system. It grants
authorised users appropriate access based on their permissions. It effectively
solves the problem of time complexity. It has never been easier to keep
information up to date. The most notable features are system security, data
security, and dependability. If necessary, the System has enough flexibility to be
modified in the future.
Index.js
12
App.js
13
Index.css
14
15
4.3 CALCULATION SNAPSHOTS
Normal weight
Under weight
16
Over weight
4.4 CONCLUSION
➢ It may overestimate body fat in athletes and others who have a muscular
build
➢ It may underestimate body fat in older persons and others who have lost
muscle.
17
4.5 REFERENCE
[1] Willett WC, Manson JE, Stampfer MJ, et al. Weight, weight change, and
coronary heart disease in women. Risk within the ‘normal’ weight range. JAMA.
1995; 273:461-5.
[2] Daniel Bugl, “Learn React Hooks: Build and Refactor Modern React.js
Applications Using Hooks”, (October 2019).
[3] AnithaGunasekaran, “react-bmi-calculator”, A simple BMI calculator built
using React JS (April 2017).
18