From 9416e00bb1c3e09445d619791c220d52d65099d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Wed, 20 Jul 2022 17:30:06 +0200 Subject: [PATCH] docs: improve wording on `pathname` and `asPath` (#38835) * Update router.md * Update router.md --- docs/api-reference/next/router.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-reference/next/router.md b/docs/api-reference/next/router.md index d0896e8ff59f..f9f3ac0e602a 100644 --- a/docs/api-reference/next/router.md +++ b/docs/api-reference/next/router.md @@ -41,9 +41,9 @@ 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`, the configured `basePath` or `locale` is not included. +- `pathname`: `String` - The path for current route file that comes after `/pages`. Therefore, `basePath`, `locale` and trailing slash (`trailingSlash: true`) are not included. - `query`: `Object` - The query string parsed to an object, including [dynamic route](/docs/routing/dynamic-routes.md) parameters. It will be an empty object during prerendering if the page doesn't use [Server-side Rendering](/docs/basic-features/data-fetching/get-server-side-props.md). Defaults to `{}` -- `asPath`: `String` - The path (including the query) shown in the browser without the configured `basePath` or `locale`. +- `asPath`: `String` - The path as shown in the browser including the search params and respecting the `trailingSlash` configuration. `basePath` and `locale` are not included. - `isFallback`: `boolean` - Whether the current page is in [fallback mode](/docs/api-reference/data-fetching/get-static-paths.md#fallback-pages). - `basePath`: `String` - The active [basePath](/docs/api-reference/next.config.js/basepath.md) (if enabled). - `locale`: `String` - The active locale (if enabled).