useAxios

wrap useRequest with axios.

A new hook.

Examples

Basic usage

API

const { loading, data } = useAxios(
  params: AxiosRequestConfig | ((...args: P) => AxiosRequestConfig),
  options?: object
);

Params

PropertyDescriptionTypeDefault
paramsSame as axios.requestObject of Function-
optionsThe same as useRequest.Options{}

最近更新: