Holy shit. This video is pure gold. Hats off to you Kyle !!!
@dilliam17023 жыл бұрын
These hooks are wild. Absolute GOLD.
@00_Andre_003 жыл бұрын
Kyle. You deserve a monument dude. For real. At least a damn trophy. Legend.
@eleah26653 жыл бұрын
These 5 are a lot better than the first 5. Thanks.
@jonathanruedas97353 жыл бұрын
when i started to familiriaze my self to js and react , this is my go to channel thumbs upp
@Skywalker37ful3 жыл бұрын
I wish you can make a video on when to make something as a component, when to refactor, like clean code for react. I face problems like this sometimes when two things have the exact same display like a big table for example but one displays one product and the other has to display an infinite amount based on user selection
@lansolo19913 жыл бұрын
Except for useFetch, all these hooks are already available through react-use, why not point at their git repo ? I guess the point is to have a better understanding of how thins work under the hood using your own refactored version ? Anyway, that is still relevant to be aware of those helpers, thanks for your work!
@JyotinderSingh3 жыл бұрын
With all the talk around external deps causing security problems, it's probably better to not have external dependencies for things you can (reliably) implement on your own. And yes as you mentioned, the learning process is important too.
@nelsonfleig50243 жыл бұрын
Good resource. It's always a good idea though to be able to implement this yourself so you can modify them to your needs since no two projects are the same.
@mountakhabi3 жыл бұрын
Hello thanks I didn’t know react-use exist it looks really cool but I think here he want you to understand what happening exactly and that’s how you make progress and be able to implement only what you need ( you will probably never use all on them)
@Tkdanimal3 жыл бұрын
this is a banger video, the title is not clickbait at all. this will save me hours.
@bobkazamakis51693 жыл бұрын
Great job brotha, waitin for Part 3 ⭐⭐⭐
@Human_Evolution-3 жыл бұрын
My favorite channel lately. Although this video was too confusing for me. Going back to your useReduce video.
@Zechey3 жыл бұрын
I've been watching these custom hook videos and it feels like he is way too fast at explaining them for a newbie. Or then I am just too slow in the head
@Human_Evolution-3 жыл бұрын
@@Zechey everyone is stupid. It's ok.
@sudeepchoudhary54673 жыл бұрын
amazing video sir i learn something new today
@mrdoner34513 жыл бұрын
Wow complicated. Need to spend more time going over the custom hooks because there's a lot going on here.
@josephwong28323 жыл бұрын
Awesome Kyle. Love these useful practical custom hook tutorials!
@emilyaung29632 жыл бұрын
I've never had a very handsome guy taught me how to code. :)) Definitely make it easier to digest what's been taught.
@dross62062 жыл бұрын
Definitely, going to be using these. I’ll need to modify the useStorage to also allow creating cookies but other than that, this is a game changer
@vdubz673 жыл бұрын
hi kyle -- can you do a series on typescript?
@hamidbakhtiari39863 жыл бұрын
this dude is great with react hooks
@RUFeelin2 жыл бұрын
Brilliant stuff, thank you
@keshavchauhan23003 жыл бұрын
Thanks Kyle.
@tadeuszjiwu2553 жыл бұрын
Thanks Kyle, I like ideas a lot. Thank You!
@caseyhald2 жыл бұрын
You are a king. Thank you sir.
@mohdhamza82193 жыл бұрын
Thank you so much Kyle. Keep doing the good work
@maximprosv3 жыл бұрын
Hello, thanks for the video. You probably have a mistake in useStorage hook if (typeof initialValue === 'function') { there is no initialValue, may be u wanted to use it like this: if (typeof defaultValue === 'function') { Thanks
@mickaelrichard72553 жыл бұрын
I was thinking the same I dont see any "initialValue" in the file
@engelshernandez58983 жыл бұрын
I guess he meant defaultValue instead of initialValue
@igors.29433 жыл бұрын
Thank you! Great content! :)
@HALsc23 жыл бұрын
omg React is so good... and kyle is so good at it
@habib_nuhu3 жыл бұрын
Thanks for sharing
@EMitkus3 жыл бұрын
Hi. Any reason why useRef is used so much in these functions? I noticed that most places the refs usually just store the state and you are changing it by assigning a new value to the ref.current. why so?
@4Z0L13 жыл бұрын
I guess its because changing ref.current doesnt cause a rerender yet it stores the value.
@alexanonym15847 ай бұрын
10:18 why useffect Is doing here? Why it wraps useCallback?
@ingles-u6bАй бұрын
I think, It's to refresh the value of the state when you change the prop. Imagine you pass a fetch to get apples, and later on the same useAsync you want to use the orange fetch, to update the value you will need use effect. Also the useEffect will be executed when the component is mounting and when you change the prop. I think it is for that. Pls correct me if I said it wrong. i'm junior 😅😅
@hurleywflow22273 жыл бұрын
Thanks, appreciated
@ariffaysal94583 жыл бұрын
excellent 👍👍
@miguelribeiro50733 жыл бұрын
These hooks are pretty cool. Definitely going to be using them in the near future. I have one question though. In the useCallback ( callbackMemoized ) of the useAsync, do you think you could have used an useReducer hook, instead of 3 useState hooks? This way you would call only one state change before running the callback function.
@jdeso33 жыл бұрын
I am building a responsive webpage which has a form on it in the form the first and last name fields are on the same line when the page gets narrower the input field for last name wraps down but the label does not then as it gets narrower the label will wrap is there anyway to make the label and input rap at the same time?
@ridl273 жыл бұрын
ty
@adicide90703 жыл бұрын
thinking about using TS maybe? I think it'd not hurt people who even don't want to use it themselves to have some basic types in there...
@braham.prakash3 жыл бұрын
This video made me feel like i knew nothing 😭😭
@spiderdev16783 жыл бұрын
THIS IS 🔥
@ravenbrotzmann18743 жыл бұрын
thanks bro
@CrAzZyKiLleR013 жыл бұрын
Hi Kyle. When you create a custom hooks you wrap every method into a useCallback. Afterwards you are returning a new object every time the hook rerenders (without useMemo it will get a new object every time). This is probably not what you want, correct? I would suggest adding a useMemo arround the returning object (or array) or am I wrong?
@CrAzZyKiLleR013 жыл бұрын
@@agenticmark I think you did not get that correct. I mean to use an additional useMemo to the returning object, not the functions itself.
@wissendev54903 жыл бұрын
Nice video Kyle but I have a question How can I use "useFetch" in a button click event I mean when I clicked the button then it'll run the "useFetch"
@aswinkumar34313 жыл бұрын
You can't use the hooks inside the function
@Will4_U3 жыл бұрын
But you can rewrite the useFetch function, so it will return also a handleFetch function, that could be passed to button as onClick.
@Pr0m0t3d3 жыл бұрын
if (typeof initialValue === 'function') shouldn't be if (typeof defaultValue === 'function')?
@abdelrahmanmostafa94893 жыл бұрын
i cant understand what {capacity = 10 } = {} means like why are we doing = {} can someone please explain
@giwrgosiwannidis46843 жыл бұрын
amazing
@samsungfateh86863 жыл бұрын
Thank you very much for the excellent training Please teach us how to upload a site when we write it And how to design a site-specific email form and send that email to all the company's customers
@sumitbarthwal9522 жыл бұрын
Can you make a hook for detecting browser back and forward button click.
@HabiburRahman-uy6qv3 жыл бұрын
I understand you
@bwustinbweem3 жыл бұрын
This guy isn’t human
@ferooref76143 жыл бұрын
Would useStateWithHistoryWork event with "value" being a function ? .... I mean history would not be an array of numbers or strings but an array of functions
@aliphian3 жыл бұрын
Could use JSON.stringify(function) to store it as text anyway. Then JSON.parse(function) to use it.
@ferooref76143 жыл бұрын
@@aliphian hmm, JSON.stringify(function) always returns an undefined ... so this would not work I suppose
@HabiburRahman-uy6qv3 жыл бұрын
I like it and you too
@user_at1803 жыл бұрын
Not an react hooks, BrainHeater hooks . Its so much complicated to understand
@igors.29433 жыл бұрын
export default function usePrevious(value) { const previousRef = useRef() useEffect(() => { previousRef.current = value }, [value]) return previousRef.current } isn't it the same but simpler?
@InstituteOfIndependence2 жыл бұрын
it does not work when name changed.
@ThePredsedatel3 жыл бұрын
not so simple 4 me
@HabiburRahman-uy6qv3 жыл бұрын
I like it
@yaroslavoz3 жыл бұрын
I feel so stupid, cause have no idea where do we need all these custom hooks with a bunch of code inside it
@sasikantnair3 жыл бұрын
Man, you speak so fast!
@HabiburRahman-uy6qv3 жыл бұрын
Kyle
@yoonuspk37983 жыл бұрын
👍
@HabiburRahman-uy6qv3 жыл бұрын
Kile hey
@longisland11313 жыл бұрын
Hey, does anyone want to work on something? I'm really looking for beginner programmers like myself to build anything. Maybe a really simple frontend of a website or even a tiny react application comment below. I just really want to collaborate with random people on something and see what that's like
@CTILET3 жыл бұрын
666 000 to oktober
@thecutedreamkostasp.44493 жыл бұрын
Didnt know u could use a hook inside a function and not just in top lvk! Wth!!!
@aravindmuthu57483 жыл бұрын
that resulting function is a custom hook
@thecutedreamkostasp.44493 жыл бұрын
@@aravindmuthu5748 yeai know! It doesnt mater is a custom hook! I have tried doing that similar with a custom hook and didnt let me