# use-axios-client

> Make axios requests in React using hooks.

Latest version **2.0.0** (published 2019-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-axios-client
pnpm add use-axios-client
yarn add use-axios-client
bun add use-axios-client
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-11-05 |
| First published | 2019-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 839.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 158 |
| Author | JP Angelle, Zak Angelle |
| Maintainers | jpangelle, zakangelle |
| Keywords | react, axios, hooks, xhr, http |

## Links

- npm: https://www.npmjs.com/package/use-axios-client
- Repository: https://github.com/angelle-sw/use-axios-client
- Homepage: https://use-axios-client.io
- Issues: https://github.com/angelle-sw/use-axios-client/issues
- npm.io page: https://npm.io/package/use-axios-client

## 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

- 2.0.0 (latest) — 2019-11-05
- 1.0.1 — 2019-10-11
- 1.0.0 — 2019-10-01
- 1.0.0-rc.2 — 2019-10-01
- 1.0.0-rc.1 — 2019-10-01
- 1.0.0-rc.0 — 2019-10-01

## README

<br />

<div align="center">
<a href="https://use-axios-client.io">
  <img
    width="353"
    alt="use-axios-client"
    src="https://www.dropbox.com/s/spy5oz3qz98pzza/use-axios-client.png?raw=1"
  />
</a>

<br />
<br />

<p>Make axios requests in React using hooks.</p>

[![CircleCI](https://circleci.com/gh/angelle-sw/use-axios-client.svg?style=shield)](https://circleci.com/gh/angelle-sw/use-axios-client) [![codecov](https://codecov.io/gh/angelle-sw/use-axios-client/branch/master/graph/badge.svg)](https://codecov.io/gh/angelle-sw/use-axios-client) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)

</div>

## Installation

with npm:

```sh
$ npm install use-axios-client
```

with yarn:

```sh
$ yarn add use-axios-client
```

## Example

```js
import { useAxios } from 'use-axios-client';

export default () => {
  const { data, error, loading } = useAxios({
    url: 'https://example/api',
  });

  return (
    <>
      {loading && <div>Loading...</div>}
      {error && <div>{error.message}</div>}
      {data && <div>{data}</div>}
    </>
  );
};
```

## Docs

- [Getting Started](https://use-axios-client.io/)
- [useAxios](https://use-axios-client.io/use-axios)
- [useLazyAxios](https://use-axios-client.io/use-lazy-axios)
- [TypeScript](https://use-axios-client.io/typescript)

## Contributing

Clone the repository:

```sh
$ git clone https://github.com/angelle-sw/use-axios-client
```

Install dependencies:

```sh
$ yarn
```

Run the example app at [http://localhost:8080](http://localhost:8080):

```sh
$ cd example
$ yarn
$ yarn start
```

Run tests using [jest](https://github.com/facebook/jest):

```sh
$ yarn test
```

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