From the course: Building a GraphQL Project with React.js

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Retrieving data

Retrieving data

- [Instructor] Let's go ahead and start building our application. And the first thing I need to do is go ahead and import the github object that I created from my database file. So that'll be ./db.js that will load up this file that has all the credentials that I will need to import my application. So next up, I'm going to also import a feature called useEffect and this feature will come from react. This is going to allow us to load up that data when we need it in our application. So, useEffect is what we call a react hook. Now, this is a feature that lets you perform what they call it side effects and function components. So if you're familiar with the way the older version of react, use life cycle methods, this is a combination of a few methods like component did mount, component did update and component well on mount. So it kind of combined in this useEffect you combine all three of those features into a single…

Contents