@axios-use/react
Advanced tools
Comparing version 6.0.0-alpha.1 to 6.0.0
@@ -0,1 +1,36 @@ | ||
# [6.0.0](https://github.com/axios-use/react/compare/v5.1.0...v6.0.0) (2022-05-15) | ||
### BREAKING CHANGES | ||
You must update all imports from '@react-cmpt/react-request-hook' to '@axios-use/react' | ||
🚨🚨🚨 Find/replace `@react-cmpt/react-request-hook` for `@axios-use/react` and upgrade to v6 | ||
### Features | ||
* Customize the Axios instance of the current item. ([#10](https://github.com/axios-use/react/pull/10)) | ||
```tsx | ||
const customIns = axios.create({ | ||
// ... | ||
}); | ||
function Profile({ userId }) { | ||
const [{ data, error, isLoading }] = useResource( | ||
(id) => ({ url: `/user/${id}` }), | ||
[userId], | ||
{ instance: customIns }, | ||
); | ||
// ... | ||
} | ||
``` | ||
* **useResource:** requestParams type can be `false`. ([887aabc](https://github.com/axios-use/react/commit/887aabcf45f3c8e1410fcff3ffc4371de511aef3)) | ||
### Chore | ||
* Upgrade devDependencies. (Typescript 4.6 [0d2b6ed](https://github.com/axios-use/react/commit/0d2b6ed6df308e67462b4852f86ec6f3bd4a8df5), React 18 [70e53cd](https://github.com/axios-use/react/commit/70e53cd7a1f6b700f6a0a78ad3c86fa7c3b5f731)) | ||
## [5.1.0](https://github.com/react-cmpt/react-request-hook/compare/v5.0.1...v5.1.0) (2022-02-13) | ||
@@ -134,3 +169,3 @@ | ||
### Features | ||
### Features (BREAKING CHANGES) | ||
@@ -137,0 +172,0 @@ * **useRequest:** swap returns ([7169e9e](https://github.com/react-cmpt/react-request-hook/commit/7169e9e5fd1fbb4d89f1f8b729d7bb773545f1cc)) |
{ | ||
"name": "@axios-use/react", | ||
"version": "6.0.0-alpha.1", | ||
"description": "A React hook plugin for Axios. Lightweight and less change", | ||
"version": "6.0.0", | ||
"description": "A React hook plugin for Axios. Lightweight, cancelable and less change", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ "Matheus Schettino <schettino2@gmail.com>", |
@@ -1,10 +0,28 @@ | ||
# @axios-use/react | ||
English | [简体中文](./README.zh-CN.md) | ||
> A React hook plugin for Axios. Lightweight and less change. | ||
<br> | ||
<p align="center"> | ||
<a href="https://github.com/axios-use/react#gh-light-mode-only"> | ||
<img src="https://raw.githubusercontent.com/axios-use/react/main/other/axios-use-react.png#gh-light-mode-only" alt="@axios-use/react - A React hook plugin for Axios. Lightweight and less change." width="460"> | ||
</a> | ||
<a href="https://github.com/axios-use/react#gh-dark-mode-only"> | ||
<img src="https://raw.githubusercontent.com/axios-use/react/main/other/axios-use-react-dark.png#gh-dark-mode-only" alt="@axios-use/react - A React hook plugin for Axios. Lightweight and less change." width="460"> | ||
</a> | ||
<br> | ||
A React hook plugin for Axios. Lightweight, cancelable and less change. | ||
</p> | ||
[![CI](https://github.com/axios-use/react/workflows/CI/badge.svg)](https://github.com/axios-use/react/actions?query=workflow%3ACI) | ||
[![npm](https://img.shields.io/npm/v/@axios-use/react.svg)](https://www.npmjs.com/package/@axios-use/react) | ||
[![GitHub license](https://img.shields.io/github/license/axios-use/react)](https://github.com/axios-use/react/blob/main/LICENSE) | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/package/@axios-use/react" target="__blank"><img src="https://img.shields.io/npm/v/@axios-use/react.svg" alt="NPM version"></a> | ||
<a href="https://github.com/axios-use/react/actions?query=workflow%3ACI" target="__blank"><img src="https://github.com/axios-use/react/workflows/CI/badge.svg" alt="ci"></a> | ||
<a href="https://github.com/axios-use/react/blob/main/LICENSE" target="__blank"><img src="https://img.shields.io/github/license/axios-use/react" alt="license"></a> | ||
</p> | ||
<br> | ||
<br> | ||
Fork: https://github.com/schettino/react-request-hook | ||
<div align="center"> | ||
<pre>npm i <a href="https://www.npmjs.com/package/axios">axios</a> <a href="https://www.npmjs.com/package/@axios-use/react"><b>@axios-use/react</b></a></pre> | ||
</div> | ||
<br> | ||
<br> | ||
@@ -31,8 +49,2 @@ ## Usage | ||
### installation | ||
```shell | ||
yarn add axios @axios-use/react | ||
``` | ||
### RequestProvider | ||
@@ -44,3 +56,3 @@ | ||
// https://github.com/axios/axios#creating-an-instance | ||
// custom Axios instance. https://github.com/axios/axios#creating-an-instance | ||
const axiosInstance = axios.create({ | ||
@@ -47,0 +59,0 @@ baseURL: "https://example.com/", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
81981
33
1
289