Home > @plasmicapp/loader-nextjs > NextInitOptions > nextNavigation

NextInitOptions.nextNavigation property

next/navigation doesn't exist prior to Next.js 13, so Plasmic can't assume the dependency exists. If you use the App Router (which depends on next/navigation), you'll need to pass the module here.

import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
import * as NextNavigation from "next/navigation";

export const PLASMIC = initPlasmicLoader({
  nextNavigation: NextNavigation,
  projects: [
    // your projects
  ],
});

Signature:

nextNavigation?: {
        notFound: unknown;
        redirect: unknown;
        useParams: unknown;
        usePathname: unknown;
        useRouter: unknown;
        useSearchParams: unknown;
    };