0

In Next JS 12 if you want to redirect you used to return an object from getServerSideProps that holds the distination path and if it is a permanent redirect or not

  return {
    redirect: {
      destination: "/",
      permanent : true
    },
  };

now in Next js 13 we should use redirect() in server components but this redirect() function does not accept any parameters other than the destination https://nextjs.org/docs/app/api-reference/functions/redirect

Jonas
  • 121,568
  • 97
  • 310
  • 388
M7mod Bakr
  • 127
  • 5

0 Answers0