Skip to content

Commit

Permalink
Fix : title element received 1 element as children Warning
Browse files Browse the repository at this point in the history
- title μš”μ†ŒλŠ” μžμ‹μœΌλ‘œ ν•˜λ‚˜μ˜ Text μš”μ†Œλ§Œ λ°›μ•„μ•Ό λœλ‹€λŠ” κ²½κ³  ν•΄κ²°
- MILI-Dream | {title}으둜 λ°›μœΌλ©΄  μ—¬λŸ¬ 개둜 μΈμ‹λ˜λŠ” 것 κ°™λ‹€.
{`MILI-Dream | ${title}`} μ΄λ ‡κ²Œ λ³€κ²½ν•˜λ©΄ κ²½κ³ κ°€ μ•ˆ λœ¬λ‹€.

Related to:
Frontend-board : /board/index.js (κ²Œμ‹œνŒ 메인 νŽ˜μ΄μ§€) #18
Make components for Frontend-board  #17

Refer to:
vercel/next.js#38256
  • Loading branch information
Turtle-Hwan committed Oct 5, 2022
1 parent a473abd commit ecaac05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions frontend/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import Seo from "../components/Seo";

import { useRouter } from "next/router";

import { Fragment } from "react";

export default function Layout({ children }) {
const router = useRouter();
const routerObj = { '/': 'Home', '/about': 'About' }
//console.log(router.pathname)
//const routerObj = { '/': 'Home', '/about': 'About' }
//console.log(typeof(router.pathname))
//{/*<Seo title={routerObj[router.pathname]} /> */}

return (
<div>
{/*<Seo title={routerObj[router.pathname]} /> */}
<Fragment>
<Seo title={router.pathname} />
<NavBar />
<div>{children}</div>
</div>
</Fragment>
)
}
}
2 changes: 1 addition & 1 deletion frontend/components/Seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Head from "next/head";
export default function Seo({ title }) {
return (
<Head>
<title>MILI-Dream | {title}</title>
<title>{`MILI-Dream | ${title}`}</title>
</Head>
)
}

0 comments on commit ecaac05

Please sign in to comment.