Skip to content

feat(react): refactor update session logic into a separate callback#12960

Open
soilSpoon wants to merge 5 commits into
nextauthjs:mainfrom
soilSpoon:feature/use-session-update
Open

feat(react): refactor update session logic into a separate callback#12960
soilSpoon wants to merge 5 commits into
nextauthjs:mainfrom
soilSpoon:feature/use-session-update

Conversation

@soilSpoon

Copy link
Copy Markdown

☕️ Reasoning

The update value in the useSession hook was changing when it shouldn't have, causing unnecessary rendering when used as a dependency in useMemo, useCallback, useEffect, etc.

To reduce this, we wrap the update in a useCallback to optimize rendering.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

@soilSpoon soilSpoon requested a review from ThangHuuVu as a code owner May 12, 2025 04:09
@vercel

vercel Bot commented May 12, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
auth-docs Ready Ready Preview Comment Oct 14, 2025 1:32am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
next-auth-docs Ignored Ignored Preview Oct 14, 2025 1:32am

@vercel

vercel Bot commented May 12, 2025

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Broken Link Checker

1 broken links found. Links organised below by source page, or page where they were found.

1) /getting-started/migrate-to-better-auth

Target Link Link Text
/docs "documentation"

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.

1 participant