Custom Hook in React for calling API — useApi

Written by rugved | Published 2021/05/30
Tech Story Tags: reactjs | react-hook | web-development | software-development | programming | coding | development | create

TLDR A custom hook is a JavaScript function whose name starts with “use” and that may call other hooks. It is the react way of writing reusable logic that can be shared among different components. In this blog we will learn about what is a custom hook and build one — useApi — to fetch data from API with reusable logic. We will build a. custom hook called use a custom. hook which will make the usual repetitive API fetch code. reusable. use a free online REST API that you can use whenever you need some fake user data.via the TL;DR App

no story

Written by rugved | Developer
Published by HackerNoon on 2021/05/30