Giter Site home page Giter Site logo

react-custom-hooks's Introduction

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.

react-custom-hooks's People

Contributors

popatre avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.