2019-05-27 20:20:33 +02:00
|
|
|
import { useRouter } from 'next/router'
|
|
|
|
|
|
|
|
const $comment = ({ gipQuery }) => {
|
|
|
|
const router = useRouter()
|
|
|
|
const { query } = router
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<p>
|
2019-08-01 18:17:42 +02:00
|
|
|
I am {query.comment} on {query.name}
|
2019-05-27 20:20:33 +02:00
|
|
|
</p>
|
2019-08-01 18:17:42 +02:00
|
|
|
<span>gip {gipQuery && gipQuery.name}</span>
|
2019-05-27 20:20:33 +02:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
$comment.getInitialProps = async ({ query }) => {
|
2019-07-23 20:33:49 +02:00
|
|
|
return { gipQuery: query }
|
2019-05-27 20:20:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default $comment
|