From 895b72ba954874a236fa6dc02315a528d34490ff Mon Sep 17 00:00:00 2001 From: Bart Nagel Date: Fri, 30 Apr 2021 16:45:35 -0700 Subject: [PATCH 1/2] Clarify whether router.pathname includes basePath --- docs/api-reference/next/router.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/next/router.md b/docs/api-reference/next/router.md index 71fc64e9f9ab9..a33ba80f3f2fd 100644 --- a/docs/api-reference/next/router.md +++ b/docs/api-reference/next/router.md @@ -41,7 +41,7 @@ export default ActiveLink The following is the definition of the `router` object returned by both [`useRouter`](#useRouter) and [`withRouter`](#withRouter): -- `pathname`: `String` - Current route. That is the path of the page in `/pages` +- `pathname`: `String` - Current route. That is the path of the page in `/pages`, and it does not include the configured `basePath`. - `query`: `Object` - The query string parsed to an object. It will be an empty object during prerendering if the page doesn't have [data fetching requirements](/docs/basic-features/data-fetching.md). Defaults to `{}` - `asPath`: `String` - The path (including the query) shown in the browser without the configured `basePath` or `locale`. - `isFallback`: `boolean` - Whether the current page is in [fallback mode](/docs/basic-features/data-fetching.md#fallback-pages). From 60b37bba7f4caa53a3716e84346ba7091945663f Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Sat, 1 May 2021 10:50:36 -0500 Subject: [PATCH 2/2] Apply suggestions from code review --- docs/api-reference/next/router.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/next/router.md b/docs/api-reference/next/router.md index a33ba80f3f2fd..4922e9196d632 100644 --- a/docs/api-reference/next/router.md +++ b/docs/api-reference/next/router.md @@ -41,7 +41,7 @@ export default ActiveLink The following is the definition of the `router` object returned by both [`useRouter`](#useRouter) and [`withRouter`](#withRouter): -- `pathname`: `String` - Current route. That is the path of the page in `/pages`, and it does not include the configured `basePath`. +- `pathname`: `String` - Current route. That is the path of the page in `/pages`, the configured `basePath` or `locale` is not included. - `query`: `Object` - The query string parsed to an object. It will be an empty object during prerendering if the page doesn't have [data fetching requirements](/docs/basic-features/data-fetching.md). Defaults to `{}` - `asPath`: `String` - The path (including the query) shown in the browser without the configured `basePath` or `locale`. - `isFallback`: `boolean` - Whether the current page is in [fallback mode](/docs/basic-features/data-fetching.md#fallback-pages).