Custom hooks :- utilising React’s ecosystem (e.g., interacting with the DOM via useRef, using context with useContext, or managing side effects with useEffect or maintaining state in it). while normail utils function can be used anywhere in code, they are not tied with react to be precise. In useCallback and useEffect dependency, also include "delay" missed from my end in video. Code :- codesandbox.io/p/sandbox/rnxq8q?file=%2Fsrc%2Fhooks%2FuseDebounce.js%3A21%2C1
Great video! I have one question, though: if we need to implement the same debouncing logic for the onChange event of an input, we wouldn't be able to use useCallback. So how would we handle debouncing in the onChange function in that case?
@@FrontendAman same doubt as @sagargarg6725 mentioned, the code you have shared is using the useCallback hook, still the solution is not with vanilla JS. How we can implement the same functionality without useCallback?
when you want to reuse business logic that is dependent on react eco system(like, state, lifecycle of component, ref ..) you can create custom hooks, it will keep your componnet clean only UI logic there.
Hello bahiya ek question hai if we implement this kinda feature in our app . Can it degrade the user experience like when user types and he/she doesn't see the changes and they might feel like the web app is kind of laggy?
Custom hooks :- utilising React’s ecosystem (e.g., interacting with the DOM via useRef, using context with useContext, or managing side effects with useEffect or maintaining state in it).
while normail utils function can be used anywhere in code, they are not tied with react to be precise.
In useCallback and useEffect dependency, also include "delay" missed from my end in video.
Code :- codesandbox.io/p/sandbox/rnxq8q?file=%2Fsrc%2Fhooks%2FuseDebounce.js%3A21%2C1
Nice content brother....just do not stop uploading such machine coding round question and thank you so much ☺
Great explanation ❤ I am very excited to check all frontend machine coding vedios 🎉
Thanks Aman your videos are indeed very helpful.
It's cool and finally got clarification on it thanks
👍👍👍👍
Great video! I have one question, though: if we need to implement the same debouncing logic for the onChange event of an input, we wouldn't be able to use useCallback. So how would we handle debouncing in the onChange function in that case?
I think me shi se question nhi smjha aapka, ek baar ye dekhna ua-cam.com/video/zTtgAiRxE1M/v-deo.html
isse shyd clear ho jae.
@@FrontendAman same doubt as @sagargarg6725 mentioned, the code you have shared is using the useCallback hook, still the solution is not with vanilla JS. How we can implement the same functionality without useCallback?
Nice Video, Question
when to use custom hooks exactly?
when you want to reuse business logic that is dependent on react eco system(like, state, lifecycle of component, ref ..) you can create custom hooks, it will keep your componnet clean only UI logic there.
@@FrontendAman Got it Thanks,
please make a video on real-time communication using web sockets as well,
waiting for other hooks videos
Frontend Sikhna hai with clarification aajao aman bhai sikhandenge.
Hello bahiya ek question hai if we implement this kinda feature in our app . Can it degrade the user experience like when user types and he/she doesn't see the changes and they might feel like the web app is kind of laggy?
It's implemented in Flipkart search. Do we feel it's laggy?
Need to keep a delay in the check. So user experience is not hamper