Skip to content

fix: reset query state on arg change (React Query v5 semantics)#60

Merged
Moon-DaeSeung merged 1 commit into
mainfrom
fix/query-arg-change-reset
Apr 12, 2026
Merged

fix: reset query state on arg change (React Query v5 semantics)#60
Moon-DaeSeung merged 1 commit into
mainfrom
fix/query-arg-change-reset

Conversation

@Moon-DaeSeung
Copy link
Copy Markdown
Contributor

Summary

  • When query(arg) is called with a different argument without keepPreviousData, data now resets to initialData and isLoading becomes true (previously data was stale and isLoading stayed false)
  • With keepPreviousData, previous data is kept as placeholder and isFetching=true, isLoading=false
  • Same-arg refetch behavior unchanged: data always kept regardless of keepPreviousData
  • Bumps version to 0.3.2

Test plan

  • Added 4 new tests covering all 3 cases (arg change without keepPreviousData, with keepPreviousData, same-arg refetch with and without keepPreviousData)
  • All 286 tests pass (282 existing + 4 new)

🤖 Generated with Claude Code

When query(arg) is called with a different argument, the previous data
was kept and isLoading stayed false. Now follows React Query v5 semantics:
- No keepPreviousData: data resets to initialData, isLoading=true
- With keepPreviousData: previous data kept, isFetching=true
- Same arg refetch: data always kept regardless of keepPreviousData

Bumps version to 0.3.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comwit-docs Ready Ready Preview Apr 12, 2026 2:33pm

@Moon-DaeSeung Moon-DaeSeung merged commit fb5dde4 into main Apr 12, 2026
1 check passed
@Moon-DaeSeung Moon-DaeSeung deleted the fix/query-arg-change-reset branch April 12, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant