Unverified Commit 960c18da authored by Luis Alvarez D's avatar Luis Alvarez D Committed by GitHub

Add docs for Router.back and Router.reload (#12396)

parent 05e93e15
...@@ -184,6 +184,26 @@ Router.beforePopState(({ url, as, options }) => { ...@@ -184,6 +184,26 @@ Router.beforePopState(({ url, as, options }) => {
If the function you pass into `beforePopState` returns `false`, `Router` will not handle `popstate` and you'll be responsible for handling it, in that case. See [Disabling file-system routing](/docs/advanced-features/custom-server.md#disabling-file-system-routing). If the function you pass into `beforePopState` returns `false`, `Router` will not handle `popstate` and you'll be responsible for handling it, in that case. See [Disabling file-system routing](/docs/advanced-features/custom-server.md#disabling-file-system-routing).
### Router.back
Navigate back in history, equivalent to clicking the back button. It executes `window.history.back()`.
```jsx
import Router from 'next/router'
Router.back()
```
### Router.reload
Reload the current URL, equivalent to clicking the refresh button. It executes `window.location.reload()`.
```jsx
import Router from 'next/router'
Router.reload()
```
### Router.events ### Router.events
<details> <details>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment