Skip to content

Commit

Permalink
mschwarzmueller#1 TIL: 동적 경로 세그먼트 접근 방법
Browse files Browse the repository at this point in the history
  • Loading branch information
JulyK9 committed Jan 6, 2023
1 parent 3399201 commit 50f3135
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pages/portfolio/[projectid].js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import router, { useRouter } from "next/router";

const PortfolioProjectPage = () => {
const router = useRouter();

console.log("router.pathname: ", router.pathname);
console.log("router.query: ", router.query);
console.log("router.query.: ", router.query.projectid);

// send a request to some backend server
// to fetch the piece of data with an id of router.query.projectid

return (
<div>
<h1>The Portfolio Project Page</h1>
Expand Down

0 comments on commit 50f3135

Please sign in to comment.