Merge branch 'master' of https://github.com/zeit/next.js
This commit is contained in:
commit
c037952b72
1 changed files with 2 additions and 2 deletions
|
@ -85,8 +85,8 @@ When state, lifecycle hooks or initial data population you can export a `React.C
|
|||
```jsx
|
||||
import React from 'react'
|
||||
export default class extends React.Component {
|
||||
async getInitialProps ({ isServer, req }) {
|
||||
return isServer
|
||||
static async getInitialProps ({ req }) {
|
||||
return req
|
||||
? { userAgent: req.headers.userAgent }
|
||||
: { userAgent: navigator.userAgent }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue