How we can listen to som eevents
some envents fire like click or automatically
responseive
reactive
interactive
flexible
How we can listen to som eevents
some envents fire like click or automatically
reactive
interactive
flexible
=
=must have one parent ellement
=
adding styles in jsx
import './subscription.css';
div className=''
dynamic data in jsx react
curly braces
{javascript code valid}
=
Data passing in react
=
communication between components
pass as prop
{},
{}
}
Accesing props in react
convert date to readable format
because for date more transformations
children props in react
why react is popular
what are the key functions of react
who can start a career as web developer , ui developer, full stack applicaitons
component
how to maintain an dpass the data in component
commuinicaion between component
modules what is modules
what is jsx
how to pass betwen data
simple to learn
waht is react
it is javascript library for building web interfaces
use to buildy higly interactive, flexible, and responsive webinterfaces
interactive -> mobile
flexible -> page ka breakout nahi, means desktop to mobile at position
responsive => fast, it will get data from backen but takes speed and
client side scription
load the code at browser
it will not load at server
what is spa
this uses dom
like tree
to render on the scren
latency decrease
user actiion -> have to react that action
for in javascript -> to write simple action shave to write too much of code
but
event listener
in javascript we cannot do after event handler calls
but in react we can call that
in react we can divide the logic into smaller reusable components
componenteasy to write
easy to understand
realt time example
react vs angular vs vue
in react -> if need any new fatures , u have ot use library
devloping using eract less features , less load on user
less learning time
angular-> so man y features are there which we are not use, heavily loaded
vuejs
setting up project
=
what installations required
visualt studio code
prettier extension
eslint
auto save in visual studoio
==
components in react
user given input and output -> interactive user interface
what is rsx
componentns
html,css,javascript basic knowledge
reac is the ligbrary based on the javascript
react js easy to use, code reusability, easy to declare
==
header is one componer
line is one component
pointer is another component
why component sis another component
how do u create component in react
write the function in component and export taht
installation of node
node js -> run javascript without browser
browser hsa capabiltiy when javascript loaded into browser
node js is used by this tool create react app to run some logic
npx create-react-app myfirst app
it willl install react folder, cretre react server
npm update or install
to install all the diependices use above
and it will save in node_modiles
after create react no need to run , npx create it already run the npm install
understanding file staructure
package.json
after installed u can see bsic files
package.json
dependecies
scripts
npm start ->
package-lok.json
information gather, dependices history , from where install whic hversion
and meta data it has
src folder
==
undertand index.js
first file that gets used when u open is indexd.js
where to start the applicaiton
what is boostrap
it will there in index.js
it is default file
first file index.html
it will call index.js
imporeted app , app.js is the ocmponent
default react logo will show from app.js
defenelty export
index.js react
convert to html, javacript
reactdom -> eract dom library
react tdom is used to render something
reactdo.nreder
========================
introduction to jsx
jsx meanss javascript + xml
xml means its one type of html
react juses jsx it is also like html but how its validate
writing html in javascript called jsx
jsx not uneerstad by browser, react will transform itno pure javascript, html, css
it has all transformed rect
bundle.js
it has also import no there
pure javascript follows the imperaqtive approach
where u give clear inster
custom components
=
react
https://www.youtube.com/watch?v=6DP7cMN99zQ
front end , back end , databse
react is a library which is used to develop front end web development
it is used to develop single page application
for example take youtube
on ist time it wll reloads
if we click on anything na it will nto reloads
it will just calling another component
component
it will load wahtever component require instead of all page loads
if all page loads it will call all apis , becasue of this it traffice increase and internet of user will be more
so if we call whatever component calls, it will save
basics
componment
props
state
web page diveide into compoentns
each element we can call as component
take webpage it is divide itno compoentns
to call componentn we are importing where ever we reqired and
calling components using props
after fetching api, load to state,
based on the lgoic and work we can divice itno smaller components
reusabilitiy
STA ->
abc -> ecomerce, cart -> + or - add items
xyz company -> ecommerce ->
senditn data from outside to component using props
using state -> varaible
once compoennt developed have to show always updated date whenever it calls
instead of getting al data ,get data using pagination
component -> class basec compoentns -> classes it has -> it used state
fbc-> it has functions-> they are using hooks
hoooks -> they are special type functions ->
node -v
have to install
npm -v
nodejs used to render react with out browser
vs code is required
extensions
es7 react/redux/graphql by rodrigovallades
npx create-react-app
npm is a node package manager, based on ur given inputs it will download to local
npx utilising that packages , after our work over its in same code level
usign package.json-> u can get all the modules if modules are lost
online react render
playcode.io/react
run the ap[plication
npm start
what is jsx
return {html tags}
writin html in js called jsx
return {
<div className="'>
normal html is class
jsx className
html for in form , javascript for loops
html to jsx convertore online tools
https://transform.tools/html-to-jsx
html
jsx
==
readme.md
what is readme.md ( this project what i doing its telling)
gitignore -> used to ignore some folders whih is used to have large files like images ,
in public
index.html
robots.txt -> which traffice will allow , which traffic will nto allow
manifest.json -> using this we can develop progress web app ( android aplication)
favicon -> icon of website
index.html
div id="root"
src folder
index.js
get root id from index,html
and load data to that id
this app means app.js
app.js
function based components
how to craete comppnents
in src folder
create cbc.js
rcc type it will create automatically class based components
fbc -> function based components
rfc type
it will create function based components
==
after created call that compoient in app.js
write CBC , it wil automatically import at starting
in cbc
mention
rco type
it will craete constructor
in fbc
use usestate hooks
how to pass props
<cbc value='vb' />
<fbc topic="react" />
cbc
<p > t his is {this.props.value} </>
fbc
<p> iam {props.topic} </p>
==
How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...