Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Fetching Data with the Fetch API

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

[SOLVED] Endpoint returns empty Array

Hi Guil Hernandez :)

I wonder if the endpoint for the Trending API at Giphy is out of date? I've set up my fetching in the App.js component but simply returns an empty array! :-)

In the meantime I'll try and have some fun with some other endpoints.

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Sorry to bother you with this but I'm going to post a pointer as to why this went wrong.

I was getting an empty array because I mistyped the method name where the API call lives... so the method to use is componentDidMount (as mentioned in the video.... not coponentDidMount ;)

Hope this helps someone along the way! :)

Thanks for posting this! I was also getting an empty array then I noticed my spelling was componentDidount After correcting that I got the array with 25 objects.