Last active
July 10, 2019 08:59
-
-
Save shipcake/75077720abe1cc15f7f2b65d4223a5ca to your computer and use it in GitHub Desktop.
test dynamic route Error??
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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