Fetch data and update your state

- [Instructor] Let's go ahead and set up our application…start receiving data from the News API…and then use lifecycle methods to update our state.…Let's work on this.…The first thing I want to show you…is if you go to Google and do a search for fetch javascript,…then you'll find the first link here,…Fetch API - Web APIs from MDN.…Click on this.…In this video, we're going to use Fetch API,…so if you want to read a little bit more in the subject,…you can go to this page and read all the functions,…all the concepts, all the documentation related to Fetch.…

I'm going to show you how to use it in a second,…but if you want to get more information before so,…you can press pause and read all that here.…Okay, so let's close that.…So, let's go back to the newsapi.org,…where I had you create an account…and now, we're going to start using this.…And also, open the Postman application…that I had you install a few videos ago.…What I want you to do this first…is copy one of the URL here,…so this get API call here or one of the others here,…

Resume Transcript Auto-Scroll

Author

Released

2/27/2018

While React simplifies the challenge of making API calls, figuring out how best to structure your application around an API is more difficult. There are two primary approaches: using the React built-in fetch methods, or using axios, a promise-based library. This course showcases the strengths of each technique. Instructor Emmanuel Henri covers the basic concepts behind REST APIs and shows how to build reusable components that use fetch methods to call real-world APIs like News API. He then shows how to connect to APIs using axios, which simplifies API calls by automatically transforming JSON data. By the end of the course, you should have the skills to structure API calls, maintain state, and make users happy.