paint-brush
Custom Hook in React for calling API — useApiby@rugved
315 reads
315 reads

Custom Hook in React for calling API — useApi

by Rugved Bongale4mMay 30th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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.

Company Mentioned

Mention Thumbnail
featured image - Custom Hook in React for calling API — useApi
Rugved Bongale HackerNoon profile picture
Rugved Bongale

Rugved Bongale

@rugved

Developer

About @rugved
LEARN MORE ABOUT @RUGVED'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Rugved Bongale HackerNoon profile picture
Rugved Bongale@rugved
Developer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here
Ichaingroup