react-use-cancel-token

JSON →
library 1.0.3 ·javascript
verified Jun 7, 2026

A React hook for canceling Axios requests using the AbortController API (newer, recommended) or legacy Axios cancel tokens (deprecated). Version 1.0.3, maintained, ships TypeScript types. Key differentiator: simplifies request cancellation in React components with a single hook, providing abort signal/cancel token generation and automatic cleanup. Compared to raw AbortController or Axios CancelToken, it integrates directly with React's lifecycle.