Skip to content

Instantly share code, notes, and snippets.

@shipcake
Last active July 10, 2019 08:59
Show Gist options
  • Save shipcake/75077720abe1cc15f7f2b65d4223a5ca to your computer and use it in GitHub Desktop.
Save shipcake/75077720abe1cc15f7f2b65d4223a5ca to your computer and use it in GitHub Desktop.
test dynamic route Error??
// products/[pid].js
import React from 'react'
const productID = (props) => {
return <>Test slug: {props.pid}</>
}
productID.getInitialProps = ({query}) => {
const {pid} =query
return {pid}
}
export default productID
import Link from 'next/link'
import React from 'react'
const Index = () => {
return <> OK <Link href={`/products/12345`}><a>sss</a></Link> </>
}
export default Index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment