You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lightweight React hook for Axios-based API calls with support for all HTTP methods.
v2.0.0 — V2 is now the default import. V2 is built on top of V1 — all V1
behaviour is preserved and the positional-arg API remains available via the
published V1 package (npm install axios-react-hook@1).
Existing ^1.0.0 users are not affected — npm never auto-upgrades across major versions.
V1 vs V2 at a glance
V1
V2
Install
npm install axios-react-hook@1
npm install axios-react-hook
Import
import useAxios from 'axios-react-hook'
import useAxios from 'axios-react-hook'
Config
Positional args
Object config
Returns
data, loading, error, refetch
data, loading, error, status, refetch, cancel
Query params
✗
params
Per-request headers
✗
headers
Timeout
✗
timeout
Callbacks
✗
onSuccess, onError
Cancellation
✗
AbortController — auto + manual
Status code
✗
status
Installation
# V2 (latest)
npm install axios-react-hook
# V1 (pin to old major)
npm install axios-react-hook@1