Do not include the basePath while using Link #63674
-
I have split a NextJS applications into 3 apps and set the basePath for 2 applications While using Link or useRouter to navigate it is appending basePath at start which is mentioned in the docs but I want to opt-out from the behaviour but I haven't found any way to do that . |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
There's an experimental feature to do this: const nextConfig = {
experimental: {
manualClientBasePath: true
}
} However, it's important to note that this feature is still in the experimental stage. |
Beta Was this translation helpful? Give feedback.
-
@mutasim77 Thank you very much 🙏 |
Beta Was this translation helpful? Give feedback.
-
This is experimental feature so it is showing strange behaviour and I think it is not suitable for production so have done this work around by appeding the domain to the url path . it prevents nextjs to append the Link.tsx
useRouter.tsx
|
Beta Was this translation helpful? Give feedback.
This is experimental feature so it is showing strange behaviour and I think it is not suitable for production so have done this work around by appeding the domain to the url path . it prevents nextjs to append the
basePath
and it does not break the single page behaviour.Link.tsx