This story on HackerNoon has a decentralized backup on Sia.
Transaction ID: 3tVrcq9qPYbHeVVES0eUujh6_5ievbhdOaQ-3YNHg30
Cover

Custom Hook in React for calling API — useApi

Written by @rugved | Published on 2021/5/30

TL;DR
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.

[story continues]


Written by
@rugved
Developer

Topics and
tags
reactjs|react-hook|web-development|software-development|programming|coding|development|create
This story on HackerNoon has a decentralized backup on Sia.
Transaction ID: 3tVrcq9qPYbHeVVES0eUujh6_5ievbhdOaQ-3YNHg30