ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

  • Next.js ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
npx create-next-app@latest

์œ„์™€ ๊ฐ™์ด ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•œ ํ›„ 

 

ํ•„์š”ํ•œ ์˜ต์…˜์„ ์„ ํƒ ํ›„ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ! ์ƒ์„ฑํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ react ์™€ ๋™์ผํ•˜๋‹ค. yarn dev ๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ๋ฉด ๋œ๋‹ค!

 

๋ ˆ์ด์•„์›ƒ ์„ค์ •

๋‚ด๊ฐ€ ๋งŒ๋“ค ํŽ˜์ด์ง€๋Š” ๋ชจ๋“  ํŽ˜์ด์ง€์— ๊ณตํ†ต์œผ๋กœ ์žˆ๋Š” ๋ ˆ์ด์•„์›ƒ์ด ํ•„์š”ํ•˜๊ณ  ๊ทธ ๋ ˆ์ด์•„์›ƒ์— ํŽ˜์ด์ง€๋ฅผ ์ด๋™ํ•˜๋Š” ๋งํฌ๊ฐ€ ํ•„์š”ํ•˜๋‹ค.

 

  • root ์˜ layout.tsx
import type { Metadata } from "next";
import "./globals.css";
import Link from "next/link";

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body>
        <header className="flex gap-10">
          <Link href={"/"}>ํ™ˆ</Link>
          <Link href={"/champions"}>์ฑ”ํ”ผ์–ธ ๋ชฉ๋ก</Link>
          <Link href={"/items"}>์•„์ดํ…œ ๋ชฉ๋ก</Link>
          <Link href={"/rotation"}>์ฑ”ํ”ผ์–ธ ๋กœํ…Œ์ด์…˜</Link>
        </header>
        {children}
        <footer>
          <div>
            <p>ํ‘ธํ„ฐ์ž…๋‹ˆ๋‹ค.</p>
          </div>
        </footer>
      </body>
    </html>
  );
}

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด header ๋ถ€๋ถ„๊ณผ footer ๋Š” ๋ชจ๋“  ํŽ˜์ด์ง€์—์„œ ๊ณตํ†ต์œผ๋กœ ๋ณด์ด๊ฒŒ ๋œ๋‹ค.

 

๊ทธ๋‹ค์Œ 3๊ฐœ์˜ ํŽ˜์ด์ง€๋ฅผ ํ•ด๋‹น ๊ฒฝ๋กœ์— ๋งŒ๋“ค์–ด์ฃผ์—ˆ๋‹ค.

  • src/app/champions/page.tsx
  • src/app/items/page.tsx
  • src/app/rotation/page.tsx 

์™„์„ฑ๋ณธ์€ ์œ„์™€ ๊ฐ™๋‹ค.

์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
Total
Today
Yesterday
๋งํฌ