Skip to content

Fix date hydration problem for match kickOff#15622

Open
marjisound wants to merge 1 commit intomainfrom
fix-date-hydration-problem
Open

Fix date hydration problem for match kickOff#15622
marjisound wants to merge 1 commit intomainfrom
fix-date-hydration-problem

Conversation

@marjisound
Copy link
Copy Markdown
Contributor

Paired with @JamieB-gu

What does this change?

The kickOff date in football match was being hydrated as a string, which caused the hydration to fail when the component tried to call .format() with it. This commit adds a fixHydration function that converts the kickOff string back into a Date object before passing it to the FootballMatchHeader component.

The kickOff date was being hydrated as a string, which caused the
hydration to fail when the component tried to call .format() with it.
This commit adds a fixHydration function that converts the kickOff
string back into a Date object before passing it to the
FootballMatchHeader component.

Co-authored-by: Jamie B <53781962+JamieB-gu@users.noreply.github.com>
@marjisound marjisound requested a review from a team March 30, 2026 16:44
@github-actions
Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@marjisound marjisound requested a review from arelra March 30, 2026 16:44
Copy link
Copy Markdown
Contributor

@jamesmockett jamesmockett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should change the type to a string which would match the fixture / results pages? (Which previously encountered the same issue.)

For now this is a good fix 👍

@jamesmockett jamesmockett added the fix Departmental tracking: fix label Mar 30, 2026
@arelra
Copy link
Copy Markdown
Member

arelra commented Mar 31, 2026

Not for this PR - but perhaps we should throw an exception if there is a JS type that we can't serialise here:

props={JSON.stringify(children.props)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Departmental tracking: fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants