DEV Community

Discussion on: Ways of Getting Data from API in React

Collapse
 
fahad07_khan profile image
Fahad Khan

I have read this blog and enjoyed it a lot but I have a question,
Which way is the best way for fetching data from backend?
I use Axios for this

Collapse
 
olenadrugalya profile image
Olena Drugalya

There is really no better way :) use what is suitable for your needs. If you ask me, I use Axios just to avoid that extra line of code to transform data to JSON object, but it requires additional import ....most people prefer fetch() because it is already built-in method