In this tutorial, you will learn how to debounce an input that automatically searches the Wikipedia API. Bonus: you will have a working React search engine app! 💯 If you have questions, join my Discord server and share your questions there: discord.gg/neKghyefqh
@oortcloud2105 ай бұрын
Clear, concise, no silly 'Game Changer!' clickbait titles - thank you! I always look for tutorials by you first if I need sound advice on how to do something well.
@DaveGrayTeachesCode5 ай бұрын
Glad I could help!
@PolycarpOkock Жыл бұрын
We have been using lodash debounce functionality for this, glad to see. Sometimes we used also the throttle just to delay the results
@DaveGrayTeachesCode Жыл бұрын
Glad this may help!
@quasi_verum Жыл бұрын
true this shoul be called useDelay, not useDebounce, because in _.debounce the function still being called when the timeout is reached, so if in case we type more than 100 char the function is still being called several time. this good when you use searching suggestion, but bad in calling api, useDelay should be better in using API.
@khalilbenmeziane8836 Жыл бұрын
I learned a lot from you, thank you dave
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@jitxhere Жыл бұрын
You are a gem Dave. Thank you for making these wonderful practical tutorials and projects.
@DaveGrayTeachesCode Жыл бұрын
You are very welcome!
@harag9 Жыл бұрын
Great tutorial, Many thanks for this. I'm currently implementing a similar feature at work and couldn't work it out to only run after x time. Though I could if it was plain javascript back in the day - React mindset is quite different.
@nextleveltech2673 ай бұрын
Thank you, it was usefull❤❤❤❤
@7doors847 Жыл бұрын
Very nice Dave!!👌
@DaveGrayTeachesCode Жыл бұрын
Thank you! Cheers!
@dr-Jonas-Birch Жыл бұрын
Great series. JB
@zombiefacesupreme Жыл бұрын
LMAO, I literally figured this out by myself the other day, but it's good to see that my code ended up very similar to yours!
@DaveGrayTeachesCode Жыл бұрын
Nice work!
@parvan7716Ай бұрын
Thank you so much for this tutorial😍😍😍😍😍😍
@adityakunwar1524 Жыл бұрын
was waiting for this video for a long time
@DaveGrayTeachesCode Жыл бұрын
I'm glad you waited and I hope it helps!
@s3interdev Жыл бұрын
Thank you Dave, very helpful.
@DaveGrayTeachesCode Жыл бұрын
Very welcome!
@azadsarxanli Жыл бұрын
You're just Amazing, Dave! Thanks a lot.
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@ankitaburman5406 Жыл бұрын
This was so smooth .. Thank you Dave .
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@romimaximus Жыл бұрын
I really wish you could, ..i mean if you can of course, .. do a tutorial about "unit tests" in a React app, and deploy using "Github actions - CI/CD"... in AWS, or any other cloud service you prefer.... I'm sure it will help lots of Devs out there, ...and also because these days, thats very important requirement that companies are looking for... And again thank you very much for always share great content..
@DaveGrayTeachesCode Жыл бұрын
Thank you for the request!
@PrashantSingh-ug6tv Жыл бұрын
Hi Dave, please also make a video on the multiple checkbox filter option as did for search and add to this playlist
@sakibcoder Жыл бұрын
very clean intructions💯
@DaveGrayTeachesCode Жыл бұрын
Glad it helped!
@TravinskiyVladislav Жыл бұрын
Thank you, Dave
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@konstantechang2779Ай бұрын
Hello dave What is the extension you using to highlight code block scope area
@hungnguyencanh5089 Жыл бұрын
Thanks, Dave
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@prakharagarwal3530 Жыл бұрын
Great 💯 I learned a neat technique to apply Role based Authorization from your authentication and authorisation playlist. thankyou 😊
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@gyglejid5 ай бұрын
Hi! I noticed that the List component is re-rendered every time the value in the search field is changed. However, the request goes away after the last change of the List component - is this a feature of useSwr? Will this not work with fetch? Am I right? Thx for video and your work!
@youssefkarfouh30848 ай бұрын
thank you so much dave
@sojocjohny Жыл бұрын
Hi, can you do a video about making a component for image cropping, resizing and converting them to base64 or File or Blob as per requirement in react typescript... That would be helpful.
@DaveGrayTeachesCode Жыл бұрын
Great suggestion! While not in React, I did do some of that in my TinyPNG clone with Vanilla JS: kzbin.info/www/bejne/oHbNoGyLrtmjf8U
@baconovertures1675 Жыл бұрын
Thanks Dave!
@aziskgarion3785 ай бұрын
That's a crisp font, what font is it I wonder.
@rounakmukherjee9540 Жыл бұрын
Thank you very much this is something that i am also looking for
@DaveGrayTeachesCode Жыл бұрын
Glad I could help!
@The.mohisa Жыл бұрын
thanke you that's really helpful
@hardwired66 Жыл бұрын
Thank you sir for the tutorial, Need tutorial for react js testing unit / testing tutorial
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@imam_robani Жыл бұрын
Cool ! I think you forgot to explain the console.log process
@DaveGrayTeachesCode Жыл бұрын
I left it in there so you could see how it works - but I did not go back to show it. For every letter you type, you will see the timeout is cleared - until you stop typing and then you will allow the final timeout to complete :)
@big-jo89 Жыл бұрын
can we just use the de-bounce as a helper function, is there any benefits from using a hook rather than just a normal function
@DaveGrayTeachesCode Жыл бұрын
That's essentially what the hook delivers. You could really ask that question about any hook that provides a function. That said, if you will use other hooks to create your function, you need to create a hook following the rules of React. We could go down a rabbit hole asking if we really need any of React's features or rules at all because it is just Javascript - but when using React, I try to do things in a React-ful way.
@kakhabervk9405 Жыл бұрын
I first of all thank for these videos. Today I searched maybe here is react-hook-form it meet me on one project and I think this hook is iteresting not nonly for me. sorry my not so english spelling.
@lebronjaimeslannister Жыл бұрын
Hi Dave, after watched the previous debounce tutorial I tried to use that vanilla way in a Next.js project, turns out it worked fine, am I missing any potential problem? or creating the custom hook for debounce is generally better for a react app. Thank you!
@DaveGrayTeachesCode Жыл бұрын
A custom hook is the React-ful way to go.
@lebronjaimeslannister Жыл бұрын
@@DaveGrayTeachesCode Thank you very much! I'll practice more to *think in react*!
@studybelief8 ай бұрын
Hi Dave, I'm wondering if I should use the debounce function written in vanilla JS for the setValue. Does it matter? `function debounce(fn, delay) { let timer; return function (...args) { clearTimeout(timer); timer = setTimeout(() => { fn(...args); }, delay); }; }`
@DaveGrayTeachesCode8 ай бұрын
Debouncing a search input is a good idea. There is also a React-ful way to do it.
@studybelief8 ай бұрын
@@DaveGrayTeachesCode Thank you sir 😊
@jaymonserrat5982 Жыл бұрын
You kind of look and sound like Aberama Gold from Peaky Blinders. Very cool 😂
@DaveGrayTeachesCode Жыл бұрын
I have not watched this - but now I want to 😀
@karthikam6395 Жыл бұрын
Thanks!
@DaveGrayTeachesCode Жыл бұрын
You're welcome and thank you for the support! 🙏💯
@Web-Himansu Жыл бұрын
sir can I start WebDevelopment skill with MDN Documentation or any programming language Documentation.
@DaveGrayTeachesCode Жыл бұрын
I think MDN provides the best HTML, CSS, and JavaScript documentation. It can be a little technical at times but it is detailed. w3Schools.com might provide easier to read documentation when starting out - but MDN is the source of truth.
@Web-Himansu Жыл бұрын
@@DaveGrayTeachesCode your advice and directions for me . I never forget 💕 💕 💕 💕 💕 💕 💕 💕 you and your guide to path that i want in my life and my goals. God always with you sir. I never forget "STRIVING FOR PROGRESS, NOT PERFECTION".
@Web-Himansu Жыл бұрын
@@DaveGrayTeachesCode sir how much time to learn javascript from MDN.
@DazzyDude00 Жыл бұрын
How would you use this without SWR? I tried using axios, useFetch, and there seems to be limitation to WikiPedia API, search value is required and on initial load the input is empty and the error shows up: 'The "gsrsearch" parameter must be set.'
@DaveGrayTeachesCode Жыл бұрын
No issue with the Wikipedia API. You can prevent sending a request until you have input - and debounce can be applied to any type of input and request - not just SWR. Here is a Vanilla JS tutorial I have on debounce: kzbin.info/www/bejne/r3OpeaqAnNZ_epY You can apply this to fetch, axios, and anything else you use to send requests.
@michaelscofield2469 Жыл бұрын
content idea: infinity scroll but not down, to top like whatsapp like slack, when we scroll top fetch the data and show
@DaveGrayTeachesCode Жыл бұрын
I'll have to check that out in Slack. Thanks for the request!
@michaelscofield2469 Жыл бұрын
@@DaveGrayTeachesCode to view old messages
@belkocik Жыл бұрын
React Debounce Search Input with react query next? :D
@DaveGrayTeachesCode Жыл бұрын
Maybe not next, but I could do that sometime. Debounce would work the same. The only difference would be how to apply it in RQ vs SWR.
@Abdullab_Niaz-ri1sc Жыл бұрын
Sir, please recommend me MERN Stack master level course
@Abdullab_Niaz-ri1sc Жыл бұрын
I wanting to become a Mern stack
@DaveGrayTeachesCode Жыл бұрын
Have you completed my MERN course? kzbin.info/www/bejne/eaemmoGbgdONZpI
@dainsleif3122 Жыл бұрын
whats with all the else if's ? friendly tip. don't use else if's its very difficult to read. this would be better if(seomething) => return 'something' if(something_else) => return something else ]