[#155] Fix DeadlineCountdown hydration mismatch#163
Conversation
Always initialize remaining as null so server and client both render the placeholder during hydration. Set the value in useEffect after mount. The lint rule is suppressed for the initial sync setState since this is the correct SSR hydration pattern. Fixes #155 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
T2b APPROVE
Correct fix. The typeof window guard from PR #153 still caused a hydration mismatch because the lazy initializer computed a value on the client while the server rendered null. Unconditional null init + useEffect setState is the standard SSR pattern. Lint suppression is appropriate here — react-hooks/set-state-in-effect is a false positive for this hydration safety pattern.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
This PR fixes the remaining DeadlineCountdown hydration mismatch by making the initial render deterministic on both server and client, then starting the countdown after mount. The lint suppression is narrowly scoped, justified by the SSR requirement, and both local validation and GitHub checks pass.
Findings
- [info] No remaining blocking findings.
- File:
src/components/DeadlineCountdown.tsx:10 - Suggestion: None.
- File:
Decision
Approving because the change directly addresses issue #155, keeps the fix contained to one component, and passes lint-and-typecheck plus local lint, typecheck, and build validation.
Summary
remainingstate asnullso server and client both render--:--:--during hydrationuseEffectafter mountreact-hooks/set-state-in-effectsuppressed with inline comment since this is the standard SSR hydration patternFixes #155
Test plan
eslint— passes (lint rule suppressed)tsc --noEmit— zero errorsnext build— clean--:--:--shows briefly during SSR🤖 Generated with Claude Code