Learn how to create Custom Hooks in React in 24 minutes (+ useRef Tutorial for beginners)

Learn how to create Custom Hooks in React in 24 minutes (+ useRef Tutorial for beginners)

Sonny Sangha

2 года назад

56,794 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

surendra jat
surendra jat - 16.09.2023 13:00

next level video

Ответить
JackM
JackM - 02.09.2023 06:42

very nice presentation. Thank you!

Ответить
ReactVerse
ReactVerse - 27.07.2023 20:58

useRef was fun ! Sonny you are best. Make this comment pinned so that sonny can see

Ответить
WhatsThisWhoa
WhatsThisWhoa - 04.06.2023 13:05

Wouldn't the 'generateJoke' function call invoke two state re-renders, causing two async fetch's since both 'firstName' and 'lastName' were iin the dependency array on the 'useRandomJoke' custom hook?

Ответить
Mehul Srivastava
Mehul Srivastava - 18.05.2023 09:11

no one can teach better react than him

Ответить
Ëřãñïĺdē
Ëřãñïĺdē - 06.05.2023 22:49

It seems the api is down. Could anyone help with the current api...

Ответить
Javier Pacheco
Javier Pacheco - 14.04.2023 15:40

thanks

Ответить
Chris Stucker
Chris Stucker - 02.03.2023 17:27

Good tutorial but I can't access the joke API? I think it's been taken down.

Ответить
phillyt22
phillyt22 - 20.02.2023 01:05

You have a gift Sonny. Thanks you.

Ответить
Patel Krupa
Patel Krupa - 08.02.2023 14:19

Useeffect have empty dependency array then why it will run every time when button click ??

Ответить
Sharon Thomas
Sharon Thomas - 16.12.2022 00:20

You are the talking documentation of React, I could binge watch this all day. Demystifying React be like this, thank you so much!!

Ответить
Sonia Blanche
Sonia Blanche - 04.12.2022 09:30

lol why are you using async with .then() instead of await

Ответить
Soja
Soja - 15.11.2022 11:14

Nice tutorial

Ответить
abdelrahman elbeltagy
abdelrahman elbeltagy - 23.10.2022 14:00

thanks bro...

Ответить
Abu Hossain
Abu Hossain - 16.09.2022 16:46

nice and simple ! thanks

Ответить
Geetesh Singh
Geetesh Singh - 20.08.2022 22:24

I tried it till the end but I was only able to generate it once. Can anyone help me, please?

Ответить
David Asiamah
David Asiamah - 06.08.2022 04:31

What can I say, man, I love your tutorials, especially the ones that you go straight to it. Your explanations are clear and simple. Thank you.🙌

Ответить
Why Cape Town
Why Cape Town - 07.07.2022 00:18

Papa React coming in clutch!

I'm working on a react native app project and I'm fetching data from an API but the problem is I'm trying to filter that data based on the category.

Would I need to build a custom hook for that?

Ответить
Exotic Coder
Exotic Coder - 21.06.2022 07:23

This is super helpful, easy to understand in a minute, Thank you Sonny

Ответить
Amrindra Ouk
Amrindra Ouk - 01.05.2022 01:38

I have learned another trick. Thank you Mr. Sonny.

Ответить
Harish G
Harish G - 29.04.2022 13:30

Now i know why I need to pass variables in a dependency array, thank you

Ответить
Gergely Grusz
Gergely Grusz - 15.04.2022 23:47

I liked this, however, I don’t understand why you didn’t simply return the generate function from the custom hook so that you can generate multiple jokes with one set of names. I don’t think you would need refs either if you did so, and it would be cleaner code.

Ответить
Felix T-Rex
Felix T-Rex - 21.03.2022 11:13

Handsome man

Ответить
cmefindaname
cmefindaname - 12.03.2022 05:03

Brilliantly explained and demonstrated! Thank you!

Ответить
Kushagra Agnihotri
Kushagra Agnihotri - 10.03.2022 08:37

I was looking for useRerf tutorail and after not getting any on this channel I found this👌greaT

Ответить
Vikas Shambhu
Vikas Shambhu - 21.02.2022 09:41

Very good & clean explanation

Ответить
Kaan
Kaan - 13.02.2022 17:32

what if we want to generate another jokes for the same name? when we don't change the name it doesn't change the state so i can't generate multiple jokes for 1 name

Ответить
Magda Gozdalik
Magda Gozdalik - 09.02.2022 20:54

You are the first person who explained in such an easy way when and why I need to pass variables in a dependency array. Thank you.

Ответить
Habibullah Shalihuddin
Habibullah Shalihuddin - 07.02.2022 17:35

What if first name and last name unchanged when fire submit

Ответить
Syed Ali Raza Rizvi
Syed Ali Raza Rizvi - 07.02.2022 03:34

Hey Sonny! Great tutorial ❤️.
One question 🙋‍♂️ Can we use Debouching in this case instead of useRef hook?

Ответить
K. Kaszubski
K. Kaszubski - 04.02.2022 18:10

Thanks!

Ответить
Ayrton Salvador
Ayrton Salvador - 07.01.2022 16:48

Thank you Sonny for this fascinating video :) Just a quick question: When I hit the 'Generate Joke' button, it generates a new joke only once. How to fix this to enable multiple consecutive clicks ? Thanks.

Ответить
Hamid R
Hamid R - 16.12.2021 08:58

Helped alot

Ответить
Danzo
Danzo - 13.12.2021 09:43

Simply perfect 100%

Ответить
amir mehrizi
amir mehrizi - 19.11.2021 12:16

it was pretty straightforward thing I have ever seen about custom hooks and ref. big like bro

Ответить
Online Shorts
Online Shorts - 14.11.2021 22:29

Sunny bro please create a search application

Ответить
Taha Virdiwala
Taha Virdiwala - 09.11.2021 10:46

Sonny could pls tell me that on Amazon clone you used firebase, does that firebase works on today's version?

Ответить
Wen Long Teo
Wen Long Teo - 05.11.2021 18:12

Erm isnt this useRandomJoke hook is a simple function that return value?

Ответить
Gh Coder
Gh Coder - 03.11.2021 18:27

Awesome video

Ответить
NITHIN PB
NITHIN PB - 02.11.2021 21:37

Your videos are amazing.
I am waiting for lucid chart/google draw clone.

Ответить
Swaubhik Chakraborty
Swaubhik Chakraborty - 02.11.2021 19:04

can you do google classroom

Ответить
Adnan Ahad
Adnan Ahad - 02.11.2021 08:18

Please make separate video of Redux tutorial please please... 😊

Ответить
Minh Hoang
Minh Hoang - 02.11.2021 05:38

Can you create a game ?

Ответить
AJEETHKUMAR R
AJEETHKUMAR R - 01.11.2021 22:08

Hey sonny, may I know the multicolor drawing pen name which you guys using on the screen

Ответить
Life Best
Life Best - 01.11.2021 13:20

Sir how to create classified ads mobile application flutter backund php

Ответить
Abdikarim Issa
Abdikarim Issa - 01.11.2021 04:46

Amazing tutorial. I started bein having love with React is. Thank you

Ответить
TraViaRoad
TraViaRoad - 31.10.2021 19:11

Awesome Explained

Ответить
Code Nerd
Code Nerd - 31.10.2021 18:20

If revolution in Teaching had a face, that's surely gonna be this webcam one......
Love from India

Ответить
Naval Malaviya
Naval Malaviya - 31.10.2021 06:52

Please make a tutorial on GIT also, please!!!

Ответить