Last active
June 11, 2017 13:11
-
-
Save quentin-sommer/fbf0f22ecb9506d135e75e4920b2c138 to your computer and use it in GitHub Desktop.
next.js getInitialProps refactoring problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomePage extends React.Component { | |
static async getInitialProps(args) { | |
return { | |
ua: args.req ? args.req.headers['user-agent'] : navigator.userAgent, | |
lang args.req.query.language, | |
foo: 'bar', | |
/* and so on.. */ | |
} | |
} | |
/* Rest of Page*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment