Created
June 27, 2017 22:05
-
-
Save elmasse/d98ab6d9cc447459dcfbe6329dc0c810 to your computer and use it in GitHub Desktop.
next issue with safari
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' | |
const Header = () => ( | |
<div> | |
<Link href='/'> | |
<a>Home</a> | |
</Link> | |
<Link href='/about'> | |
<a>About</a> | |
</Link> | |
</div> | |
) | |
export default Header |
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
export default () => ( | |
<div> | |
<p>This is the about page</p> | |
</div> | |
) |
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 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> | |
) | |
} | |
} |
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
module.exports = { | |
exportPathMap: () => { | |
return { | |
'/': { page: '/index'}, | |
'/about': { page: '/about'} | |
} | |
} | |
} |
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
{ | |
"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