rsnext/test/integration/dynamic-routing/pages/[name]/[comment].js

22 lines
391 B
JavaScript
Raw Normal View History

import { useRouter } from 'next/router'
const $comment = ({ gipQuery }) => {
const router = useRouter()
const { query } = router
return (
<>
<p>
I am {query.comment} on {query.name}
</p>
<span>gip {gipQuery && gipQuery.name}</span>
</>
)
}
$comment.getInitialProps = async ({ query }) => {
return { gipQuery: query }
}
export default $comment