we are going to talk about making a custom hook!

We are going to make the fetch code a bit reusable. To get things starting, you should have this running:

npx JSON-server — watch data/data.json — port 8000

and

npm start

Then start by creating a file in the src folder call it “useFetch.js.” We need to put the keyword “use” in front of the custom hook, or it won't work.

After you do that, it should look like this: