mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Update Readme.md
This commit is contained in:
parent
429668b464
commit
dfe1bc70a4
|
@ -85,7 +85,7 @@ 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 }) {
|
||||
static async getInitialProps ({ isServer, req }) {
|
||||
return isServer
|
||||
? { userAgent: req.headers.userAgent }
|
||||
: { userAgent: navigator.userAgent }
|
||||
|
|
Loading…
Reference in a new issue