0% found this document useful (0 votes)
9 views

React Js

Uploaded by

Avishi Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

React Js

Uploaded by

Avishi Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

REACT JS

- BY AVISHI JAIN
INTRODUCTION

• React is a Javascript library created by Facebook.


• It is User Interface (UI) library.
• It is a tool for building UI components.
• To create any react application, we use the “create-react-app” command that provides all
the necessary files.
• It basically renders HTML on a web page.
ADVANTAGES

• Creating dynamic web applications becomes easier (also uses JSX).


• The components can be reused any number of times.
• Uses Virtual DOM.
• Gives better control through unidirectional data flow.
• Simplicity.
• Performance.
JSX (JAVASCRIPT EXTENSION)

• All react components are rendered through the render function. These render functions
specify the HTML output of the react component.
• JSX, is a react extension that allows writing Javascript code that looks like HTML.
COMPONENTS

• In this approach, the entire application is divided into small logical groups of code which
are called components.
• It is also considered the building block of any react application.
• Each component exists in the same space but they work independently from one another.
• We have 2 types of components- Functional and Class Components.
PROPS

• Props stands for properties. It is an object that stores the value of attributes of a tag.
• It is used to pass the data in the same way as arguments in a function to components.
• Props are immutable so we can’t modify them from inside the components.
• These can be used to render the dynamic data in the render method.
CONDITIONAL RENDERING

• We can render any component based on the conditions.


• Generally, if-else conditions and ternary operators are used to render any condition on the
components.
STATE

• State is one of the hooks which provide access to the state and other react features.
• It allows us to track and update the state in a functional component.
• Firstly, we have to import the useState hook from react. Then it takes two arguments,
which take the current state and the updated value. Also, the default value is passed as an
argument.
THANK YOU

You might also like