Development/React.js

next - Head 컴포넌트

moretz0921 2022. 5. 15. 20:22

<Head></Head> 컴포넌트를 사용해서 html의 <head></head>태그를 컨트롤 할 수 있다.

일반적으로는 head의 title태그나, meta태그 등을 페이지 별로 다르게 적용할 때 사용할 수 있다.

 

// pages/index.js

import Head from 'next/head'

const Index = () => (
    <>
        <Head>
            <title>Next.js Head</title>
        </Head>
        <div>
            Next.js
        </div>
    </>
)

export default Index;

 

 

출처

https://jjamong.github.io/docs/front/react/nextjs/head/

 

next/head | 짜몽 개발 연구소

next/head 컴포넌트를 사용해서 html의 태그를 컨트롤 할 수 있습니다. 일반적으로는 head의 title태그나, meta태그 등을 페이지 별로 다르게 적용할 때 사용할 수 있습니다. 시작하기 // pages/index.js import

jjamong.github.io