mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
22 lines
422 B
JavaScript
22 lines
422 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
const Comment = ({ gipQuery }) => {
|
|
const router = useRouter()
|
|
const { query } = router
|
|
|
|
return (
|
|
<>
|
|
<p id="asdf">
|
|
I am {query.comment} on {query.name}
|
|
</p>
|
|
<span data-testid="gip-query">gip {gipQuery && gipQuery.name}</span>
|
|
</>
|
|
)
|
|
}
|
|
|
|
Comment.getInitialProps = async ({ query }) => {
|
|
return { gipQuery: query }
|
|
}
|
|
|
|
export default Comment
|