Skip to content

Instantly share code, notes, and snippets.

View estebanmunchjones2019's full-sized avatar

Esteban Munch Jones estebanmunchjones2019

View GitHub Profile
export async function getStaticProps(context) {
// some back end code here
return {
props: {}, // will be passed to the page component as props
}
}
@estebanmunchjones2019
estebanmunchjones2019 / [id].js
Last active April 1, 2021 18:17
subscription.js
// pages/products/[id].js
import { getProduct, getProductsIds } from '../../actions'
import Link from 'next/link'
export default function ProductDetail({product}){
return (
<div className="container">
<div className="row">
import '../styles/globals.css'
import Layout from '../components/layout'
function MyApp({ Component, pageProps }) {
return (
<div>
<Layout>
{/* <Component /> represents each route's content */}
<Component {...pageProps} />
</Layout>
@estebanmunchjones2019
estebanmunchjones2019 / App.js
Last active March 18, 2021 11:58
Next.js article for eincode.com -- React demo code
import { Route, Switch} from 'react-router-dom';
import './App.css';
import Home from './Home';
import About from './About';
import Contact from './Contact';
import Layout from './Layout';
function App() {
return (