mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This ensures we are able to properly replace even when an env variable value wasn't initially provided and also ensures an env that is interpolated in a string properly replaces. We don't use the stringified version of `process.env` as that can cause issues with interpolation and such.
24 lines
669 B
JavaScript
24 lines
669 B
JavaScript
import React from 'react'
|
|
import Link from 'next/link'
|
|
import dynamic from 'next/dynamic'
|
|
import styles from '../styles/shared.module.css'
|
|
|
|
const Button = dynamic(() =>
|
|
import('../components/button/button').then((mod) => mod.Button)
|
|
)
|
|
|
|
export default function Page() {
|
|
return (
|
|
<>
|
|
<p id="hello" className={styles.content}>
|
|
hello from pages/index
|
|
</p>
|
|
<Link href="/dashboard">Dashboard</Link>
|
|
<p id="react-version">{React.version}</p>
|
|
<Button>Click me!</Button>
|
|
<span id="my-env">{process.env.NEXT_PUBLIC_TEST_ID}</span>
|
|
<span id="my-other-env">{`${process.env.NEXT_PUBLIC_TEST_ID}-suffix`}</span>
|
|
</>
|
|
)
|
|
}
|