Create a custom hook that allows you to fetch the movies from the Lord of the Rings API.
You’re creating a fan review website for the Lord of the Rings and need movie details. To do that, you need to make requests to the API on multiple pages, so having a reusable hook would be helpful. Your assignment is to create a custom hook that you can use on any page to request movie info from the API.
To build a custom hook, the first thing you need is a file that exports a custom function. You can do this manually or you can start your entire project automatically by using the useCustomHook starter template.
With the skeleton of a hook, the main purpose will be to fetch data from the API. Set up a request mechanism using the browser fetch API or your favorite request library.
More levels including the ability to save your progress coming soon!
Get all projects as an ebook right to your inbox for FREE!