МА
Size: a a a
МА
МА
МА
П
МА
DP
АФ
type Props = {
domain?: string
}
const IndexPage = ({domain}: Props) => (
<Layout title="Home | Next.js + TypeScript Example">
<h1>Hello Next.js 👋</h1>
<p>
<Link href="/about">
<a>About</a>
</Link>
</p>
<p>{domain}</p>
{console.log(domain)}
</Layout>
)
IndexPage.getInitialProps = (ctx) => {
const domain: string = ctx.req.headers.host
console.log(domain)
return { props: { domain } }
}
export default IndexPage
ВЛ
type Props = {
domain?: string
}
const IndexPage = ({domain}: Props) => (
<Layout title="Home | Next.js + TypeScript Example">
<h1>Hello Next.js 👋</h1>
<p>
<Link href="/about">
<a>About</a>
</Link>
</p>
<p>{domain}</p>
{console.log(domain)}
</Layout>
)
IndexPage.getInitialProps = (ctx) => {
const domain: string = ctx.req.headers.host
console.log(domain)
return { props: { domain } }
}
export default IndexPage
ВЛ
{ domain }
ВЛ
АФ
АФ
ВЛ
D
type Props = {
domain?: string
}
const IndexPage = ({domain}: Props) => (
<Layout title="Home | Next.js + TypeScript Example">
<h1>Hello Next.js 👋</h1>
<p>
<Link href="/about">
<a>About</a>
</Link>
</p>
<p>{domain}</p>
{console.log(domain)}
</Layout>
)
IndexPage.getInitialProps = (ctx) => {
const domain: string = ctx.req.headers.host
console.log(domain)
return { props: { domain } }
}
export default IndexPage
АФ
ВЛ
D
ВЛ