Skip to content

Commit

Permalink
Updated docs for pathname (#9964)
Browse files Browse the repository at this point in the history
* Updated docs for pathname

* Apply suggestions from Tim

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Removed trailing dots

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
  • Loading branch information
Luis Alvarez D and timneutkens committed Jan 8, 2020
1 parent 3c8fff3 commit 18d8c90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/api-reference/data-fetching/getInitialProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ For the initial page load, `getInitialProps` will execute on the server only. `g

`getInitialProps` receives a single argument called `context`, it's an object with the following properties:

- `pathname` - path section of URL
- `query` - query string section of URL parsed as an object
- `pathname` - Current route. That is the path of the page in `/pages`
- `query` - Query string section of URL parsed as an object
- `asPath` - `String` of the actual path (including the query) shown in the browser
- `req` - HTTP request object (server only)
- `res` - HTTP response object (server only)
Expand Down
3 changes: 1 addition & 2 deletions docs/api-reference/next/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export default ActiveLink

The following is the definition of the `router` object returned by both [`useRouter`](#useRouter) and [`withRouter`](#withRouter):

- `route`: `String` - Current route
- `pathname`: `String` - Current path excluding the query string
- `pathname`: `String` - Current route. That is the path of the page in `/pages`
- `query`: `Object` - The query string parsed to an object. Defaults to `{}`
- `asPath`: `String` - Actual path (including the query) shown in the browser

Expand Down
7 changes: 3 additions & 4 deletions packages/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ For the initial page load, `getInitialProps` will execute on the server only. `g

`getInitialProps` receives a context object with the following properties:

- `pathname` - path section of URL
- `query` - query string section of URL parsed as an object
- `pathname` - Current route. That is the path of the page in `/pages`
- `query` - Query string section of URL parsed as an object
- `asPath` - `String` of the actual path (including the query) shows in the browser
- `req` - HTTP request object (server only)
- `res` - HTTP response object (server only)
Expand Down Expand Up @@ -807,8 +807,7 @@ See [Disabling File-System Routing](#disabling-file-system-routing).

Above `Router` object comes with the following API:

- `route` - `String` of the current route
- `pathname` - `String` of the current path excluding the query string
- `pathname` - `String` of the current route. That is the path of the page in `/pages`
- `query` - `Object` with the parsed query string. Defaults to `{}`.
- `asPath` - `String` of the actual path (including the query) shows in the browser
- `push(url, as=url)` - performs a `pushState` call with the given url
Expand Down

0 comments on commit 18d8c90

Please sign in to comment.