mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
aa0ba3c30a
Co-authored-by: Jiachi Liu <inbox@huozhi.im> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
15 lines
399 B
JavaScript
15 lines
399 B
JavaScript
export default function Runtime() {
|
|
let runtime
|
|
|
|
if (typeof window !== 'undefined') {
|
|
// We have to make sure it matches the existing markup when hydrating.
|
|
runtime = document.getElementById('__runtime').textContent
|
|
} else {
|
|
runtime =
|
|
'Runtime: ' +
|
|
(process.version ? `Node.js ${process.version}` : 'Edge/Browser')
|
|
}
|
|
|
|
return <span id="__runtime">{runtime}</span>
|
|
}
|