Skip to content

Instantly share code, notes, and snippets.

@elmasse
Created June 27, 2017 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmasse/d98ab6d9cc447459dcfbe6329dc0c810 to your computer and use it in GitHub Desktop.
Save elmasse/d98ab6d9cc447459dcfbe6329dc0c810 to your computer and use it in GitHub Desktop.
next issue with safari
import Link from 'next/link'
const Header = () => (
<div>
<Link href='/'>
<a>Home</a>
</Link>
<Link href='/about'>
<a>About</a>
</Link>
</div>
)
export default Header
export default () => (
<div>
<p>This is the about page</p>
</div>
)
import React, { Component } from 'react'
import fetch from 'unfetch'
import Header from '../components/header'
export default class Index extends Component {
static async getInitialProps({ req }) {
if (!req) {
const nf = await fetch('no-found')
return nf
}
return {}
}
render() {
return (
<div>
<Header />
<p>Hello Next.js</p>
</div>
)
}
}
module.exports = {
exportPathMap: () => {
return {
'/': { page: '/index'},
'/about': { page: '/about'}
}
}
}
{
"name": "next-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "next",
"build": "next build && next export"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"next": "^3.0.1-beta.2",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"unfetch": "^2.1.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment