1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
This commit is contained in:
nkzawa 2016-10-09 18:25:52 +09:00
commit c037952b72

View file

@ -85,8 +85,8 @@ When state, lifecycle hooks or initial data population you can export a `React.C
```jsx ```jsx
import React from 'react' import React from 'react'
export default class extends React.Component { export default class extends React.Component {
async getInitialProps ({ isServer, req }) { static async getInitialProps ({ req }) {
return isServer return req
? { userAgent: req.headers.userAgent } ? { userAgent: req.headers.userAgent }
: { userAgent: navigator.userAgent } : { userAgent: navigator.userAgent }
} }