Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose basePath in useRouter #74715

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

Netail
Copy link
Contributor

@Netail Netail commented Jan 9, 2025

Expose the basePath value in the app router useRouter(), just like the pages router useRouter(), as support wasn't implemented at that time yet. I pass it down, the same way as the assetPrefix

basePath has been removed. The alternative will not be part of useRouter. It has not yet been implemented.

~ https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#step-5-migrating-routing-hooks

We expose this basePath to the client, so client components can use the basePath + a route for API fetch requests

@ijjk ijjk added Documentation Related to Next.js' official documentation. tests type: next labels Jan 9, 2025
@ijjk
Copy link
Member

ijjk commented Jan 9, 2025

Allow CI Workflow Run

  • approve CI run for commit: 9d22e18

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@Netail Netail force-pushed the feat/base-path-navigation-base-path branch from 4b72ad4 to f9e562f Compare January 9, 2025 22:22
@Netail Netail marked this pull request as draft January 10, 2025 22:49
@Netail Netail force-pushed the feat/base-path-navigation-base-path branch from f9e562f to 9d22e18 Compare January 11, 2025 00:17
@Netail Netail marked this pull request as ready for review January 11, 2025 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation. tests type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants