# usefetch-custom-params

> A custom use fetch hook with parameters

Latest version **1.0.3** (published 2020-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install usefetch-custom-params
pnpm add usefetch-custom-params
yarn add usefetch-custom-params
bun add usefetch-custom-params
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-06-26 |
| First published | 2020-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daniel Ancuta |
| Maintainers | daniel.ancuta |
| Keywords | custom hook, fetch, hook, parameters, react-component, light hook, useFetch custom parameters |

## Links

- npm: https://www.npmjs.com/package/usefetch-custom-params
- npm.io page: https://npm.io/package/usefetch-custom-params

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-06-26
- 1.0.2 — 2020-06-26
- 1.0.1 — 2020-06-26
- 1.0.0 — 2020-06-26

## README

# useFetch custom parameters

## Install

`npm i usefetch-custom-params`


```jsx

import React from "react";
import useFetch from 'usefetch-custom-params';

const Hook = () => {
    const url = 'http://ergast.com/api/f1/2004/1/results.json';
    const { data } = useFetch(url)

    console.log(data);

    return (
        <div>
            test
        </div>
    );
}

export default Hook;

```

## Parameters

url, params(`query params`), isLoading, hasError, errorMessage

```jsx
if (isLoading) {
    return <LoadingComponent>....</LoadingComponent>
}

if (hasError) {
    return <ErrorComponent>{errorMessage}</ErrorComponent>
}
```

---
_Source: https://npm.io/package/usefetch-custom-params · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
