<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
'Development > React.js' 카테고리의 다른 글
next - font를 글로벌 처리할 때 문제점 (0) | 2022.05.15 |
---|---|
Prop `className` did not match. (0) | 2022.05.15 |
next - _app.js (0) | 2022.05.15 |
리엑트에서 moment.js 사용하기 (0) | 2022.05.14 |
redux 에서 비동기 처리 어떻게 해야할까? (0) | 2022.05.14 |