• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    해결됨

3강 routes.tsx 파일 생성 안되시는분!

23.09.27 03:46 작성 23.09.27 03:47 수정 조회수 330

5

import { lazy } from "react";
import GlobalLayout from "./src/pages/_layout";

const Index = lazy(() => import("./src/pages/index"));
const PoroductsIndex = lazy(() => import("./src/pages/products/index"));
const ProductsId = lazy(() => import("./src/pages/products/[id]"));

export const routes = [
  {
    path: "/",
    element: <GlobalLayout />,
    children: [
      { path: "/", element: <Index /> },
      { path: "/products", element: <PoroductsIndex /> },
      { path: "/products/:id", element: <ProductsId /> },
    ],
  },
];

export const pages = [
  { route: "/" },
  { route: "/cart" },
  { route: "/payment" },
  { route: "/products" },
  { route: "/products/:id" },
];

windows 이고 파일 자동생성이 안되서 하나씩 쳤네요ㅠㅠㅠㅠㅠㅠㅠ
저와 같이 고생하시는 분 계실까봐 남겨놓습니다

경로만 체크하시면 될거같아요!

답변 1

답변을 작성해보세요.

0

감사합니다!