rsnext/test/e2e/switchable-runtime/utils/time.js
Tim Neutkens aa0ba3c30a
Ensure server components entries are not part of the pages buildmanifest (#38416)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-07-07 22:17:17 +02:00

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>
}