NextRouter was not mounted.
Answered
Cinnamon posted this in #help-forum
CinnamonOP
Trying to get data from the link using:
and importing this component to a page, but loading the page gives me the error page attached. please help and thank you
const router = useRouter();
if (!router.isReady) return null;
const {business, table} = router.query;and importing this component to a page, but loading the page gives me the error page attached. please help and thank you
4 Replies
@Cinnamon Trying to get data from the link using:
tsx
const router = useRouter();
if (!router.isReady) return null;
const {business, table} = router.query;
and importing this component to a page, but loading the page gives me the error page attached. please help and thank you
where are you importing the router from?
Answer
for app dir you import from
next/navigation, while for pages dir you import from next/routerCinnamonOP
thank you
you saved me