Fetching Data

You will get to learn how to fetch data from an API using one the lifecycle methods that we discussed in the previous lesson.

We'll cover the following

Now we’re prepared to fetch data from the Hacker News API. There was one lifecycle method mentioned that can be used to fetch data: componentDidMount(). Before we use it, let’s set up the URL constants and default parameters to break the URL endpoint for the API request into smaller pieces.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy