DEV Community

Cover image for How to fetch data from API in ReactJS

How to fetch data from API in ReactJS

Aditya Saini on March 08, 2023

Web development nowadays seems incomplete without API's as most of the websites we build are using some kind of API to power a feature in it or to ...
Collapse
 
codeofrelevancy profile image
Code of Relevancy

Great article and you explained very well about the usage of dependencies with useEffect

Collapse
 
adityasaini3 profile image
Aditya Saini

Thank you very much bro

Collapse
 
clericcoder profile image
Abdulsalaam Noibi

Thanks for writing this Amazing Article. I just used the use effect hook in a movie review web application to fetch movie api from the omdb movie api.

Thanks once again.

Collapse
 
adityasaini3 profile image
Aditya Saini

Welcome and Thank you for the appreciation

Collapse
 
leocifer profile image
Lionel Dsilva

This was very helpful

Collapse
 
adityasaini3 profile image
Aditya Saini

Thank you 😊

Collapse
 
lukeluke98 profile image
Lukeluke98

Great guide

Collapse
 
adityasaini3 profile image
Aditya Saini

Thank you 😊

Collapse
 
amn3s1a2018 profile image
Amn3s1a2018

With all due respect, I have to ask. Why are there zillions out there of tutorials and articles about data fetching in usEffect hook? while in most cases this is the worst possible way to do it. In the shiny new Next.js we can simply call async functions in Page components, but even before that we had useSWR or useQuery for API calls.

Collapse
 
shoulao profile image
Marcin

I feel like every article here is just a copy and paste from the doc. There are XXX numbers of articles about the same thing.

Collapse
 
manikantasriram profile image
Manikanta Sriram

Great Information. I personally use Axios to make API calls and bind the data.

Collapse
 
asif6021 profile image
Asif

Thank you sir. I am learning full stack it is very helpful me to understand how it works.