1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-higher-order-component/pages/index.js
David Nguyen 3c71e818bf Example/add high order component example (#2331)
* temporary commit

* update code

* completed example higher order component

* remove custom server
2017-06-21 19:45:06 +02:00

21 lines
419 B
JavaScript

import React from 'react'
import withApp from '../components/withApp'
class Index extends React.Component {
static getInitialProps (context) {
const { isServer } = context
return { isServer }
}
render () {
const { greeting } = this.props
return (
<div>
<h2>Index page</h2>
<h3 style={{ color: 'red' }}>{greeting}</h3>
</div>
)
}
}
export default withApp(Index)