Skip to content

Instantly share code, notes, and snippets.

@Hurly77
Created April 23, 2021 02:16
Show Gist options
  • Save Hurly77/eeccea9253b55799ba463124b7280776 to your computer and use it in GitHub Desktop.
Save Hurly77/eeccea9253b55799ba463124b7280776 to your computer and use it in GitHub Desktop.
const HomePage = (props) => {
return (
<div>
<li></li>
<li></li>
<li></li>
</div>
)
}
// we always want to return an object with a key props
// The cool thing about this function is that instead of rendering the component function first we'll execute the getStaticProps function get our data and then render that data into the HomPage component.
export const getStaticProps = async() => {
return {props: {
products: [id: 'p1', title: 'Product 1']
}}
}
export default HomePage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment