FSD-II Notes
FSD-II Notes
1a
__Shew.
Get Array FeO
function
fusName length
(Updating
ae s a mponent life cycle has tree main pl
= * yolue =f name} D- Mounting phase —
legate £22) getname CO} In_when component is created
e-texget ted_in Coppje) into the pom
> ao =
The updating phase accu when a com
Inmnount phase —
—_usetffect Hook -
: React useef
such_as__fechiny
_ These hooks “june
is also a way of using dependeny array
@ scanned with OKEN Scannerwhich we con
u
funchena)
Setting up a _subseriplion_o»
2b (3 used fe mimic tne
af tos based _carnpanent
Syntow ae
mport React . f usestote use€Flect
from ‘reach a
function, Demet)
yD) eae
Callbade function?
Contain_the code te, hes
the use _effeck digger
Dependency: oe
IL 1 an optional pore, suse!
when the given
_trample -
UseFfectHoole js ~
component such
Inport f_usestate , use Effect
function use ffect Hook Of
const [counts sehGeun:
suseltfed (CO rf
console tog C0" Only: stake
contro!_the
ix_used_fe hondle a side ofica
aa
import { useSinie ,_usccfect} fram “react
function _use EffectHook 0
} Casuat, setcounter] > uaesianteh?
const C msg, setmeg] = useStote(“Hel!0')
usebFfed (0 = -
‘i — ee
JetTime Out C0) =>
ie a ae! can
Pas. C Good Morning") 5 _
dependensy js_change
mounted
—
soStete Co)
@ scanned with OKEN Scanner—— te = tesponge-json ©
then (json ~ console Jog Cjson))
JL. Lressurcetype)) Seitems e
fetch (' hHpe: I! joonplacenalder - hy picede con
$ {_resaurcely pe
“then (rss pons =} tespenae:jgon 0) YT
radu ch list
mport React. {
Soe peoesceeo aaa
const [dota , setdata] = useStete (C2) __
[7 prods
reluen (
_ Pests set Resource Ty pe
“users ‘J%2 Users
4, tet oir) = 10,12, 447 ae
a let area = Clo,ia, 31g ~
console leg Carel == ara)
is required
% —fensole.leg CoriginalArray)+
nsele log C copiedAray )>
@ scanned with OKEN ScannerUsePel Hook +
EDOM cituclune manipulation
UsePet hook ae
= UseRef_is_a_renct_haok thal lets
Aeterence 6 volue thats
__tendering
isdonet
ie — usRe[ Cimbal value)
3 Exomple | ees =
——imperi React, f yackel} fem “yeas
o-———__-firnetion_tayCemponent ©
Se
zt Tons! _inihalret useReF(O)s
cons) inihislPef = ysorel (mui
____ Text Reader js
fusePef} from -react
Text Reader 0
ong! _fealYiew 2 usePet Co),
iperYal
textiew current focus 0)
—textView current slyle_harhgraundte
Initial value at
The value you pant te ref object "current
properly” do be“ inikially . + can be value of
a ‘any dype z
de
useRef
T_tetums on object a single property.
port defaul} TextReder
current C properby)
Tnifiauy i+ set to the joHal value you
Red fs color change
hove passed, if you passed the reference obj.
to_reack as o reference ottribute to JSx node
—reoct oil! set its current property.
crenge
Take_a textbox os user in pub a color name
background celer_shovid be changed using
the
ugereF
§_usestate.
@ scanned with OKEN Scannerouter —__——~
eee ae een Simiby te Link but provides
omipenent within your oj —_———sitributes hen the link ig ocHve
ee redone eee — iene
Example
—Yarloie com penenr ins reoch appt alloys aie
aS ranging the browser ul and teep the ae —.—it—=™
sync aja ith the a Se cee eee
fois Feoluve of the react router impart —toleleomefrem__{-corapanentel (fel
a import {@rowserRouter a3 Router. Route, Link , Poutes}
Ee 3. Decorative routes [cas
yet router dem" 5
2
navigation function App 0)
2): Trngrrove typescript support
Browaer Poulter -
the
__iheod :
—eoute_poth = */ Hello” Component?
aerrs
+ "Tileleome"¥ Component =Funchon seer
const para = use feroms 0
onsh f. = pore i
return (
‘
= Welcome user islogged in You might also like