0

I've wrote a whole code of site using but unfortunetly in NextJS 13 it doesn't scroll me to top of the page after redirect. Any ideas why? I checked documentation and there is scroll={true} as default, even if I added it doesnt work :/

I don't add some code becouse it's global but here's example of my Link:

<Link href={`/dzial/${department.urlName}`} className={`${ className } w-48 h-48 xl:w-48 xl:h-48 2xl:w-64 2xl:h-64 items-center justify-start relative cursor-pointer hover:scale-[1.1] duration-300`}>

There is no error message. Just after redirect, page doesnt scroll to top.

  • Did you try `useRouter` hook? Because the `scroll` property is a feature specific to the `router.push` method. Check out this section: https://nextjs.org/docs/pages/api-reference/functions/use-router#routerpush – Emre May 21 '23 at 22:20
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 21 '23 at 22:59
  • are you using nextjs routing system? its hard to find an issue when so many variables are unknown in your post. – Lith May 21 '23 at 23:08

0 Answers0