mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Update README.md
This commit is contained in:
parent
7ab4f54971
commit
7baebd0c0f
|
@ -183,15 +183,8 @@ You can also do client-side page transitions using the `next/router`
|
|||
```jsx
|
||||
import Router from 'next/router'
|
||||
|
||||
const routeTo(href) {
|
||||
return (e) => {
|
||||
e.preventDefault()
|
||||
Router.push(href)
|
||||
}
|
||||
}
|
||||
|
||||
export default () => (
|
||||
<div>Click <a href='#' onClick={routeTo('/about')}>here</a> to read more</div>
|
||||
<div>Click <span onClick={() => Router.push('/about')}>here</span> to read more</div>
|
||||
)
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue