mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
399e510389
* Make sure lastAppProps always have some value. * Revert "Make sure lastAppProps always have some value." This reverts commit b4ae722d9c1a4460e17dbdc041b111cbd492b2aa. * Throw an error, if we found an empty object from getInitialProps. * Add proper tests for getInitialProps empty check.
31 lines
684 B
JavaScript
31 lines
684 B
JavaScript
import Link from 'next/link'
|
|
import { Component } from 'react'
|
|
|
|
let counter = 0
|
|
|
|
const linkStyle = {
|
|
marginRight: 10
|
|
}
|
|
|
|
export default class extends Component {
|
|
|
|
increase () {
|
|
counter++
|
|
this.forceUpdate()
|
|
}
|
|
|
|
render () {
|
|
return (
|
|
<div className='nav-home'>
|
|
<Link href='/nav/about'><a id='about-link' style={linkStyle}>About</a></Link>
|
|
<Link href='/empty-get-initial-props'><a id='empty-props' style={linkStyle}>Empty Props</a></Link>
|
|
<p>This is the home.</p>
|
|
<div id='counter'>
|
|
Counter: {counter}
|
|
</div>
|
|
<button id='increase' onClick={() => this.increase()}>Increase</button>
|
|
</div>
|
|
)
|
|
}
|
|
}
|