aa0ba3c30a
Co-authored-by: Jiachi Liu <inbox@huozhi.im> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
12 lines
308 B
JavaScript
12 lines
308 B
JavaScript
export default function Time() {
|
|
let time
|
|
|
|
if (typeof window !== 'undefined') {
|
|
// We have to make sure it matches the existing markup when hydrating.
|
|
time = document.getElementById('__time').textContent
|
|
} else {
|
|
time = 'Time: ' + Date.now()
|
|
}
|
|
|
|
return <span id="__time">{time}</span>
|
|
}
|