Created
May 28, 2023 18:18
-
-
Save khg0712/c0b626092fd79e348ed2b52e3a51fc01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SSR 시점에 Router 싱글톤에 접근할 때 Next.js page 컴포넌트 예시 | |
import Router from 'next/router' | |
export default function page() { | |
return ( | |
<div> | |
{/* 아래 에러 발생 | |
* Error: No router instance found. | |
* You should only use "next/router" on the client side of your app. | |
* /} | |
{JSON.stringify(Router.query)} | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment