Skip to content

MKD01/react-custom-hooks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom React Hooks

Setup

  1. npm install

  2. npm run dev to start the server

Task

  1. Refactor BooksGrid to use a custom hook named useGoogleBooks - the file has been created for you in the hooks folder.

You should be able to refactor BooksGrid with your custom hook to enable the component to still work.

  1. Google books also accepts the ability to limit the amount of results via a parameter of maxResults. Add some more functionality to your custom hook/app to enable the amount of results to be limited

  2. Create a new hook named usePublishersBooks. This hook should accept a publisher and a limit as arguments. It should make a request using the getPublishersBooks api function (already created for you).

Use this hook to update the modal when you click a book. The modal should show 3 books by the same publisher of the book.

  1. Create a hook named useModal which will handle the state, as well as the functions to open/close the modal.

Extra

  1. Add some routing and create a route to a publishers page. /publishers/:publisher. Use your usePublishersBooks hook to list books by a specific publisher.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 65.4%
  • CSS 29.3%
  • HTML 5.3%