I hereby claim:
- I am quentin-sommer on github.
- I am sommer_q (https://keybase.io/sommer_q) on keybase.
- I have a public key ASCbytiPgVwvY0GrBLiNYfhN2kG1rzc8Me1ZnELj5PTqtAo
To claim this, I am signing this object:
| window.globalData = {test: 'value'} |
| /* imports */ | |
| const PageWrapper = Comp => | |
| class extends React.Component { | |
| /* | |
| * We need to use args.ctx here instead of args | |
| * See https://github.com/zeit/next.js#custom-document | |
| */ | |
| static async getInitialProps(args) { | |
| return { |
| const PageWrapper = Comp => | |
| class extends React.Component { | |
| static async getInitialProps(args) { | |
| return { | |
| ua: args.req ? args.req.headers['user-agent'] : navigator.userAgent, | |
| ...(Comp.getInitialProps ? await Comp.getInitialProps(args) : null), | |
| } | |
| } | |
| render() { |
| class Page extends React.Component { | |
| static async getInitialProps(args) { | |
| return { | |
| ua: args.req ? args.req.headers['user-agent'] : navigator.userAgent, | |
| } | |
| } | |
| render() { | |
| const {ua} = this.props | |
| return ( |
| const PageWrapper = Comp => ( | |
| class 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.. */ | |
| ...(Comp.getInitialProps ? await Comp.getInitialProps(args) : null), | |
| } |
| 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*/ |
I hereby claim:
To claim this, I am signing this object:
| *.o | |
| ~* | |
| *~ | |
| *.out | |
| #*# | |
| \#* |
| using System; | |
| class Program | |
| { | |
| public void main(String[] args) | |
| { | |
| Console.WriteLine("Hello world!"); | |
| } | |
| } |