Build useFetch Custom React Hook to Fetch Data in 20 Minutes

preview_player
Показать описание
In this video we will build a powerful Custom React Hook useFetch() that will help us to fetch the data from server along with that it will provide us different API request states like data, loading, fetching, error which we can use throughout our application.

We will use Axios for making API request, useReducer for managing the local state of the hook and useEffect for running the API request sideeffect.

🔥 Relevel by Unacademy👇
It is India's first platform to help all aspirants have access to their dream job. By taking the Relevel Test, they engage in comprehensive skill assessments, which evaluate industry relevant skills and their job-readiness.

⭐️GitHub link for Reference⭐️

⭐️ Support my channel⭐️

***React Roadmap for Developers in 2021***

***More videos***

***Checkout my Crash courses for get started with web development***

🔗 Social Medias 🔗

⭐️ Tags ⭐️
- Build useFetch React Hook
- Data Fetching using React Hook useFetch
- Making a Custom Hook - useFetch
- Learn React Custom Hook - useFetch

⭐️ Hashtags ⭐️
#react #custom #hooks #beginners #tutorial #dipeshmalvia

Disclaimer:
It doesn't feel good to have a disclaimer in every video but this is how the world is right now.
All videos are for educational purpose and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.
Рекомендации по теме
Комментарии
Автор

Guys, if the video is helpful to you or you learned something than please appreciate and hit the LIKE and SUBSCRIBE button and help this channel to GROW😉

DipeshMalvia
Автор

u rock man, it was very useful to me, I was working on a website for my master on IT and I didn't understand anything about custom hooks, I really apreciate and kudos to u. regards

luisantoniogutierrezmedina
Автор

keep going brother.
your react code so clean.

RanaAhmed-grub
Автор

sir mujhe english achee tara nahin ati .but apka video dekha kar mujhe achaa lagta hin maine react ka fundamental advanced sab apke video sahin sika hoo ..but kuch dino se apka video nahinn araha hain to thora video lekar aye koi naya project lekar react kar ...intezar main hoon apke video ka

arnabchakraborty
Автор

Great. I'll extend it a little bit more for handling graphql calls with InMemory cache.

codedusting
Автор

Nice illustration of creating a custom hook to fetch data. Thanks, Dipesh

{2022-10-14}

Pareshbpatel
Автор

Thanks for all your content
It is really helpfull for me.

gastonartazayanez
Автор

Very good way of implement network request in ReactJs, could you make a video with post method. I like the level of abstraction

abdullahclementabdulshekur
Автор

Very Well explained.👌
Thank you🤝
How to handle multiple API calls in single component?

subhashgn
Автор

Awesome. Really appreciate it. Got to know a new thing.

ShaikhAhmedReza
Автор

Hi Dipesh, please tell me which one is better for state management
1) context api
2) redux
3) recoil

pateljay
Автор

I've seen several videos about api hooks, the problem is that I don't want to load when starting the screen, in the example when starting the app it triggers the useFetch, I want to do this when I click on the button, onClick, I can't do it?

alexon
Автор

This is a good video. Unfortunately the part where it's suppose to display an error if there's a problem with the request doesn't work. I changed the error object from null to Boolean to make it work. I don't know if it's the best option.

Olatee
Автор

Please use arrow functions for defining func comp :)

fitnesspriority
Автор

So if we have custom hooks then why to use high order component?

sachinkotian
Автор

I really like combining useReducer and useEffect when I need to fetch data, but using the same code over and over again was getting way too repetitive.
Sadly, for some reason this doesn't work with the tmdb api.
I can't access my data from useFetch in the App component, all I get is an empty array.
Weirdly enough, the console.log(payload) from useFetch displays the data.

mariusgardelli
Автор

Hello sir, I have a frontend built with React and a backend built with Node JS and Express. I want to hosting the site with cPanel. How can I do this? Please help me sir.

rajeshmondal
Автор

Hi bro, Please post react and redux testing stuffs like jest, React testing lib.

ganeshk