Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

TimeAgo + SSR somewhat problematic #288

Description

@adamschwartz

Our use of <TimeAgo/> is slightly wonky with SSR:

<TimeAgo date={tutorial.updated} formatter={(value, unit) => (
<React.Fragment>
{value} {unit}{value > 1 ? "s" : ""}<span className="DocsTutorials--ago-text"> ago</span>
</React.Fragment>
)} minPeriod={60}/>

It can flash "N hours ago" and then switch to "3 days ago" on page load for example. This is because the SSR time will be locked in at the last time it was built, but upon hydration it will be from now.

We could potentially use HTMLRewriter to set on the fly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions