Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

performance.ui

Cancel inflight fetches inside React effects

React effects that fetch remote data should attach AbortSignal wiring so stale responses cannot commit after dependencies change.

#Metadata

Rule ID
ts.react.no-effect-fetch-without-cancellation
Severity
medium
Confidence
0.74
Languages
javascript, typescript
Presets
strict
Stability
experimental
Applies to
function
Tags
performance, react, rules-catalog

#Why it matters

Race conditions from abandoned requests produce inconsistent UI state and duplicated side effects when identifiers or routes change quickly.

#Remediation

Thread AbortController.signal through fetch or axios calls and abort inside the effect cleanup, or migrate to a data library that manages cancellation.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-effect-fetch-without-cancellation.rule.yaml.