Skip to content

fix: resolve stale state issues caused by missing React hook dependencies#656

Open
akashgoudsidduluri wants to merge 2 commits into
durdana3105:mainfrom
akashgoudsidduluri:fix/react-hook-dependency-stale-state
Open

fix: resolve stale state issues caused by missing React hook dependencies#656
akashgoudsidduluri wants to merge 2 commits into
durdana3105:mainfrom
akashgoudsidduluri:fix/react-hook-dependency-stale-state

Conversation

@akashgoudsidduluri
Copy link
Copy Markdown
Contributor

Summary

This PR resolves React Hook dependency warnings that could lead to stale closures and outdated state being used inside effects.

Changes

  • Memoized callback functions with useCallback where required
  • Updated useEffect dependency arrays
  • Replaced stale state updates with functional state updates where appropriate
  • Ensured effects and subscriptions remain synchronized with current state

Files Updated

  • src/components/FocusTimer.tsx
  • src/components/GroupPomodoro.tsx
  • src/components/Room.tsx
  • src/components/Whiteboard/Canvas.tsx
  • src/pages/Dashboard.tsx
  • src/pages/Leaderboard.tsx

Verification

  • Ran npm run lint
  • React Hook dependency warnings for the affected files are no longer reported
  • No new ESLint errors introduced

Fixes #643

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@akashgoudsidduluri is attempting to deploy a commit to the durdana3105's projects Team on Vercel.

A member of the Team first needs to authorize it.

@akashgoudsidduluri
Copy link
Copy Markdown
Contributor Author

Hey @durdana3105 can you review this PR.

@durdana3105
Copy link
Copy Markdown
Owner

Hey @durdana3105 can you review this PR.

please resolve the merge conflicts

@akashgoudsidduluri
Copy link
Copy Markdown
Contributor Author

Hey @durdana3105 i have resolved the conflicts, you can review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React hooks contain missing dependencies that can lead to stale state

2 participants