mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
23 lines
562 B
JavaScript
23 lines
562 B
JavaScript
import React from 'react'
|
|
import Link from 'next/link'
|
|
|
|
export default class AsyncProps extends React.Component {
|
|
static async getInitialProps ({ query: { id = 0 } }) {
|
|
return { id }
|
|
}
|
|
|
|
render () {
|
|
return (
|
|
<div>
|
|
<Link href={`/nav/querystring?id=${parseInt(this.props.id) + 1}`}>
|
|
<a id='next-id-link'>Click here</a>
|
|
</Link>
|
|
<Link href='/nav/querystring'>
|
|
<a id='main-page'>Click here</a>
|
|
</Link>
|
|
<p className={`nav-id-${this.props.id}`}>{this.props.id}</p>
|
|
</div>
|
|
)
|
|
}
|
|
}
|