79527852

Date: 2025-03-22 17:49:14
Score: 0.5
Natty:
Report link

The new way with Next.js 15+ would be to use the router in "next/navigation" when calling from the client side ('use client') like this:

For the import:

import { useRouter } from 'next/navigation';

In your React component:

  const router = useRouter();
  router.replace(...);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Flo