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.
Platform link - https://relvl.co/93nn
Leaderboard- https://relevel.com/leaderboard
Business Development: https://bit.ly/3AyFU5r
Backend Development: https://bit.ly/3uZsjmj
Frontend Development: https://bit.ly/3DksJGJ
⭐️GitHub link for Reference⭐️
https://github.com/dmalvia/React_Custom_Hook_UseFetch
⭐️ Support my channel⭐️
https://www.buymeacoffee.com/dipeshmalvia
***React Roadmap for Developers in 2021***
How to Learn React JS ? - /watch/c5Ocp8jVy60Vc
React Fundamentals Project - /watch/si02owKGJoQG2
Learn React Redux with Project - /watch/ISCKYL5i6W0iK
What is Redux ? - /watch/cCWCB9nNjNqNC
Learn React Redux Thunk with Project - /watch/cdWNGLfRZDJRN
***More videos***
JSON Crash Course - /watch/Ij_v2fbMhO6Mv
Asynchronous Vs Synchronous Programming - /watch/EXcC3yciseoiC
Async JavaScript Callback - /watch/wu5wvEvuez1uw
Async JavaScript Promises Tutorial - /watch/AzpP2zR4VvJ4P
***Checkout my Crash courses for get started with web development***
JavaScript Tutorial For Beginners - /watch/oR8ggb-StpsSg
HTML5 Crash Course in 1 Hour - /watch/cgasmsFQ3jAQs
CSS Crash Course in 1 Hour - /watch/cl_A_U_ksYnkA
🔗 Social Medias 🔗
Twitter: https://twitter.com/IMDmalvia
Facebook: https://www.facebook.com/programmingwithdipesh
Instagram: https://www.instagram.com/dipeshmalvia
LinkedIn: https://www.linkedin.com/in/dmalvia/
⭐️ 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.
@DipeshMalviaمنذ 3 سنوات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 13
@
@codedustingقبل 6 أشهرGreat. I'll extend it a little bit more for handling graphql calls with InMemory cache.
@
@ShaikhAhmedReza786منذ 3 سنواتAwesome. Really appreciate it. Got to know a new thing.
@
@abdullahclementabdulshekur6736منذ 2 سنواتVery good way of implement network request in ReactJs, could you make a video with post method. I like the level of abstraction 1
@
@mariusgardelli4262منذ 2 سنوات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. id="hidden2" class="buttons"> 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. ....وسعت
@
@RanaAhmed-gr4ubمنذ 3 سنواتkeep going brother. your react code so clean. 3
@
@rajeshmondal8392منذ 3 سنوات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.
@
@alexon2010العام الماضي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 id="hidden4" class="buttons"> it triggers the useFetch, I want to do this when I click on the button, onClick, I can't do it? ....وسعت
@
@subhashgn1775منذ 3 سنواتVery Well explained. Thank you How to handle multiple API calls in single component?
@
@gastonartazayanez3730منذ 3 سنواتThanks for all your content It is really helpfull for me. ✌ 1
@
@sachinkotian2829منذ 2 سنواتSo if we have custom hooks then why to use high order component? 1
@
@ganeshk8410منذ 3 سنواتHi bro , Please post react and redux testing stuffs like jest, React testing lib.
@
@fitnesspriorityمنذ 3 سنواتPlease use arrow functions for defining func comp :) 1
@
@Olateeمنذ 3 سنوات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 id="hidden5" class="buttons"> the error object from null to Boolean to make it work. I don't know if it's the best option. ....وسعت
@
@arnabchakraborty3595منذ 3 سنوات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 id="hidden6" class="buttons"> ..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 ....وسعت1
@
@pateljay5351منذ 3 سنواتHi Dipesh, please tell me which one is better for state management 1) context api 2) redux 3) recoil
@
@Pareshbpatelمنذ 2 سنواتNice illustration of creating a custom hook to fetch data. Thanks, Dipesh {2022-10-14}
مقاطع الفيديو ذات الصلة على Build useFetch Custom React Hook to Fetch Data in 20 Minutes:
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. ....وسعت
your react code so clean. 3
Thank you
How to handle multiple API calls in single component?
It is really helpfull for me.
✌ 1
1) context api
2) redux
3) recoil
{2022-10-14}