Skip to content

Instantly share code, notes, and snippets.

@klaasvw
Created November 29, 2023 16:06
Show Gist options
  • Save klaasvw/ff85cbd703492ad06be5150307cbd59e to your computer and use it in GitHub Desktop.
Save klaasvw/ff85cbd703492ad06be5150307cbd59e to your computer and use it in GitHub Desktop.
Access Next.js basePath without hooks
import Router from "next/router";
export const functionName = () => {
console.log(Router.basePath);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment