fix(core): avoid Date.now() calls in memo when debug is disabled#6156
fix(core): avoid Date.now() calls in memo when debug is disabled#6156ckdwns9121 wants to merge 3 commits intoTanStack:mainfrom
Conversation
|
📝 WalkthroughWalkthroughIntroduces a derived Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
This PR fixes an issue where
Date.now()was being called in the memo function even when debug mode was disabled. This was causing React hydration mismatch warnings in Next.js applications because the rendering timestamp differed between server and client.🎯 Changes
opts.debug?.()result before callingDate.now().Date.now()is only invoked when debugging is actually active.🩹 Fixes
(a?: number)to allow optional arguments.✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.