useAxios
wrap useRequest
with axios.
A new hook.
Examples
Basic usage
API
const { loading, data } = useAxios(
params: AxiosRequestConfig | ((...args: P) => AxiosRequestConfig),
options?: object
);
Params
Property | Description | Type | Default |
---|---|---|---|
params | Same as axios.request | Object of Function | - |
options | The same as useRequest . | Options | {} |