Skip to content

Fix useApi infinite refetch loop caused by inline body/options object #895

Description

@RUKAYAT-CODER

Overview
In src/hooks/useApi.ts, fetchData (lines 47-78) lists body in its dependency array and the mount effect (lines 80-87) depends on fetchData. Because callers pass options/body as inline object literals, body's identity changes every render, recreating fetchData and re-firing the fetch on every render — an infinite fetch loop hidden by eslint-disable comments. Serialize deps (e.g. via a stable dedupe key) rather than relying on raw object identity.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions