Repository navigation
fix(DatePicker): render the clock's month labels on the client - #376
Conversation
A picker with no date opens on the current month. Prerendered in one month and opened in the next, its header hydrated the server's month against the visitor's and threw React #418, which fails the docs build's browser check on /form-controls/datePicker whenever the check's clock crosses a month. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YJHdG7ZbpQS64MtL5PVbT1
|
Compare flagged one shot: Generated by Claude Code |
|
The re-run of Compare flagged a different shot: Generated by Claude Code |
…fix/date-picker-hydration-month # Conflicts: # CHANGELOG.md
Before: a DatePicker with no date, prerendered in one month and opened in the next, threw React #418 on load ("October" from the server against "November" in the browser). The docs build's browser check opens pages 25 hours after the build, so since 22:53 UTC on 30 October every 3.0 Docs build fails on
/form-controls/datePicker(#371 and #372 included).After: a picker that opens on the clock's month renders its month and year labels on the client, as its day grid already did. A picker with a date still renders them on the server.
How: a
useSyncExternalStorehydration flag gates the two header labels and their aria-labels only when the picker has novalueordefaultValue. Two tests cover it: the server markup holds no month name with no date (fails without the fix), and the mounted picker names the current month. Verified locally by rebuilding the docs and runningcheck:renderon every form-controls page: 0 problems (4 before).Generated by Claude Code