Next getServerSideProps context.params에 favicon이 왜.. 때문일까요..?
미해결
브라우저 창 주소 - localhost:3000/nickname 컴포넌트 내부 import { useRouter } from 'next/router'; const MyPost = () => { const router = useRouter(); const { pagename } = router.query; console.log(pagename); // 결과 - nickname 정확히 출력 }; getServerSideProps 내부 export const getServerSideProps = wrapper.getServerSideProps(async (context) => { console.log(context.params); // 결과 - { pagename : 'favicon.ico' } ?? }); useRouter의 query와 context의 params가 같은 역할을 하는걸로 배웠는데... getServerSideProps 에서 왠 ' favicon.ico '가 ?? 출력이 되는걸까요...? 당황쓰...
- next
- ssr
- getserversideprops
- 다이나믹라우팅
이룸
댓글 1
좋아요 0
조회수 284





