useRequest: Simple custom hook for handling requests
useRequest
Simple custom hook for handling requests
With npm:
npm install --save use-request-react-hook
With yarn:
yarn add use-request-react-hook
This is how you are going to use it : =>
import { useRequest } from 'use-request-react-hook';
const Example = () => {
const { response, error, isLoading } = useRequest({ url: 'SomeEndpoint' });
return <div>Example</div>;
};