Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
ccaf640b
Unverified
Commit
ccaf640b
authored
Nov 11, 2017
by
Tim Neutkens
Committed by
GitHub
Nov 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document router events the way they are used (#3268)
parent
dc07cd1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
readme.md
readme.md
+6
-6
No files found.
readme.md
View file @
ccaf640b
...
@@ -474,15 +474,15 @@ This uses of the same exact parameters as in the `<Link>` component.
...
@@ -474,15 +474,15 @@ This uses of the same exact parameters as in the `<Link>` component.
You can also listen to different events happening inside the Router.
You can also listen to different events happening inside the Router.
Here's a list of supported events:
Here's a list of supported events:
-
`
r
outeChangeStart(url)`
- Fires when a route starts to change
-
`
onR
outeChangeStart(url)`
- Fires when a route starts to change
-
`
r
outeChangeComplete(url)`
- Fires when a route changed completely
-
`
onR
outeChangeComplete(url)`
- Fires when a route changed completely
-
`
r
outeChangeError(err, url)`
- Fires when there's an error when changing routes
-
`
onR
outeChangeError(err, url)`
- Fires when there's an error when changing routes
-
`
b
eforeHistoryChange(url)`
- Fires just before changing the browser's history
-
`
onB
eforeHistoryChange(url)`
- Fires just before changing the browser's history
-
`
a
ppUpdated(nextRoute)`
- Fires when switching pages and there's a new version of the app
-
`
onA
ppUpdated(nextRoute)`
- Fires when switching pages and there's a new version of the app
> Here `url` is the URL shown in the browser. If you call `Router.push(url, as)` (or similar), then the value of `url` will be `as`.
> Here `url` is the URL shown in the browser. If you call `Router.push(url, as)` (or similar), then the value of `url` will be `as`.
Here's how to properly listen to the router event
`
r
outeChangeStart`
:
Here's how to properly listen to the router event
`
onR
outeChangeStart`
:
```
js
```
js
Router
.
onRouteChangeStart
=
url
=>
{
Router
.
onRouteChangeStart
=
url
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment