1.0.12 • Published 3 years ago
use-fetch-custom-params v1.0.12
useFetch custom hook with parameters
Usage
Install the package in your project:
npm i use-fetch-custom-params@1.0.3
In your code:
import useFetch from 'use-fetch-custom-params'
const url = 'https://jsonplaceholder.typicode.com/posts';
const { data, isLoading, hasError, errorMessage, setNewUrl, updateParams } = useFetch(url);
console.log(data);