Skip to content

refactor: replace useEffect with React Query#271

Merged
ruudandriessen merged 1 commit intomainfrom
ruudandriessen/cape-town-v4
Mar 10, 2026
Merged

refactor: replace useEffect with React Query#271
ruudandriessen merged 1 commit intomainfrom
ruudandriessen/cape-town-v4

Conversation

@ruudandriessen
Copy link
Copy Markdown
Owner

Summary

Remove 3 useEffect hooks and replace with modern React patterns. AddProjectDialog now uses useQuery for data fetching and useMutation for form submission. SessionState uses render-time state reset instead of useEffect dependency tracking.

Eliminates 4 manual state variables and removes the useCallback/useEffect chain. Net -16 lines of code.

Changes

  • Replace useCallback + useEffect with useQuery (enabled on dialog open)
  • Replace try/catch/finally state management with useMutation (isPending, error)
  • Move state reset from useEffect to render-time check (prevents extra render)
  • Remove unused Installation type

🤖 Generated with Claude Code

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 8, 2026

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

Project Deployment Actions Updated (UTC)
clanki-ai Ready Ready Preview, Comment Mar 8, 2026 5:56pm
clanki-ai-marketing Ready Ready Preview, Comment Mar 8, 2026 5:56pm

…dates

Remove 3 useEffect hooks and replace with modern React patterns:
- AddProjectDialog: useQuery for data fetching, useMutation for form submission
- SessionState: render-time state reset instead of useEffect dependency tracking

Eliminates 4 manual state variables (installations, repos, loading, creating, error) and removes useCallback/useEffect chain.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@ruudandriessen ruudandriessen force-pushed the ruudandriessen/cape-town-v4 branch from 2fcd5d0 to fd00681 Compare March 8, 2026 17:55
@ruudandriessen ruudandriessen merged commit 251f113 into main Mar 10, 2026
8 checks passed
@ruudandriessen ruudandriessen deleted the ruudandriessen/cape-town-v4 branch March 10, 2026 20:08
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