提交 06b8e5e6 编写于 作者: N Nathan Agrin 提交者: Naoyuki Kanezawa

Fix userAgent reference in getInitialProps example (#81)

The getInitialProps example references `req.header.userAgent`, which does not exist. `req.headers['user-agent']` does.
上级 95719c95
......@@ -108,7 +108,7 @@ import React from 'react'
export default class extends React.Component {
static async getInitialProps ({ req }) {
return req
? { userAgent: req.headers.userAgent }
? { userAgent: req.headers['user-agent'] }
: { userAgent: navigator.userAgent }
}
render () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册