From the course: React.js: Building an Interface

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

useEffect and useCallback Hooks

useEffect and useCallback Hooks - React.js Tutorial

From the course: React.js: Building an Interface

Start my 1-month free trial

useEffect and useCallback Hooks

- [Instructor] Normally your data wouldn't be coming from your own project. You would be checking this data that JSON file usually from an API, like GraphQL or your own REST API. So to simulate that we're going to take this data with our JSON file. And let me make this bigger because this is probably going to crash our application. And we're going to put it in the public folder. That means that it will export with our project and be available as a URL. So this is similar to what would happen if you were getting this data from an API. So in order to get that to work within our project we're going to have to use a few other hooks in our React application. And the hooks that we have to use will need to be imported. So we will import three different hooks into this project. We'll start with useState, which we've already seen. and then also work with useEffect and another one called useCallback. And these will get imported…

Contents