nextjs Data List
- NEXT.JS 기본개념
- NEXT.JS 설치
- NEXT.JS 실행방법
- NEXT.JS 파일 및 구조
- NEXT.JS 데이터 가져오기
- NEXT.JS API 쿼리데이터 생성
- NEXT.JS Components
- NEXT.JS page.js 파라미터 처리
- NEXT.JS app router 방식 client ip 주소 가져오는 방법
- NEXT.JS monaco-editor 사용방법
- NEXT.JS react-quill 사용방법
- NEXT.JS app router 방식 rss feed.xml 간단하게 설정 방법
- NEXT.JS app router 방식 sitemap.xml 간단하게 설정 방법
NEXT.JS page.js 파라미터 처리
2023-11-14 00:00:00
/ 목차 /
- NEXT.JS page.js 파라미터 처리
- params
- searchParams
NEXT.JS page.js 파라미터 처리
- 화면에 데이터값을 전달할때 사용하는 소스입니다.code export default function Page({ params, searchParams, }: { params: { slug: string } searchParams: { [key: string]: string | string[] | undefined } }) { return <h1>My Page</h1> }
params
- app/shop/[slug]/page.js /shop/1 { slug: '1' } - app/shop/[category]/[item]/page.js /shop/1/2 { category: '1', item: '2' } - app/shop/[...slug]/page.js /shop/1/2 { slug: ['1', '2'] }searchParams
- /shop?a=1 { a: '1' } - /shop?a=1&b=2 { a: '1', b: '2' } - /shop?a=1&a=2 { a: ['1', '2'] }
Comment