mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
aa0ba3c30a
Co-authored-by: Jiachi Liu <[email protected]> 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>
|
|
}
|