Created
December 9, 2019 08:30
-
-
Save robbertvancaem/7b38dce0d56160e8b4c9fa879b235dd4 to your computer and use it in GitHub Desktop.
dynamic-routing-now-3
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
// pages/post.js | |
import React from 'react'; | |
const Post = ({ slug }) => <div>{slug}</div>; | |
Post.getInitialProps = async ({ query }) => { | |
const { slug } = query; | |
return { | |
slug | |
} | |
} | |
export default Post; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment