@axios-use/react
Advanced tools
Changelog
6.1.0 (2022-07-05)
feat(useRequest): return all response. (e9317ce)
interface CreateRequest {
// Promise function
- ready: () => Promise<[Payload<TRequest>, AxiosRestResponse]>;
+ ready: () => Promise<[Payload<TRequest>, AxiosResponse]>;
// Axios Canceler. clear current request.
cancel: Canceler;
}
- const [{ data, error, isLoading, other }] = useResource(...)
+ const [{ data, error, isLoading, response }] = useResource(...)
No BREAKING CHANGES. Will keep other
value, but deprecated.
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
const customIns = axios.create({
// ...
});
function Profile({ userId }) {
const [{ data, error, isLoading }] = useResource(
(id) => ({ url: `/user/${id}` }),
[userId],
{ instance: customIns },
);
// ...
}
false
. (887aabc)Changelog
6.1.0 (2022-07-05)
feat(useRequest): return all response. (e9317ce)
interface CreateRequest {
// Promise function
- ready: () => Promise<[Payload<TRequest>, AxiosRestResponse]>;
+ ready: () => Promise<[Payload<TRequest>, AxiosResponse]>;
// Axios Canceler. clear current request.
cancel: Canceler;
}
- const [{ data, error, isLoading, other }] = useResource(...)
+ const [{ data, error, isLoading, response }] = useResource(...)
No BREAKING CHANGES. Will keep other
value, but deprecated.
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
const customIns = axios.create({
// ...
});
function Profile({ userId }) {
const [{ data, error, isLoading }] = useResource(
(id) => ({ url: `/user/${id}` }),
[userId],
{ instance: customIns },
);
// ...
}
false
. (887aabc)