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.