-
Notifications
You must be signed in to change notification settings - Fork 3
fix: hydration mismatch from client-server date differences #23
Copy link
Copy link
Open
Labels
advancedComplex challenge (3-6 hours)Complex challenge (3-6 hours)bugSomething isn't workingSomething isn't working
Description
Problem Description
Date formatting can cause hydration mismatches when server and client render different relative times.
Context
Relative time strings like 'in 2 days' may differ between server render and client hydration.
Files to Investigate
src/lib/date-utils.ts- getRelativeTime functionsrc/components/event-card.tsx- Time display
Steps to Reproduce
- View events list page
- Check browser console for hydration warnings
- Relative times may differ by seconds
Expected Behavior
Date formatting should not cause hydration mismatches.
Acceptance Criteria
- No hydration warnings in console
- Dates render consistently
- Consider suppressing hydration for time elements
- Or use client-only rendering for relative times
Suggested Approach
Use suppressHydrationWarning or render dates client-side only with useEffect.
Difficulty: Hard
Estimated time: 3-6 hours
Prerequisites: React hydration, SSR concepts
Learning outcomes: SSR best practices, hydration debugging
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
advancedComplex challenge (3-6 hours)Complex challenge (3-6 hours)bugSomething isn't workingSomething isn't working