Skip to content

Commit

Permalink
Revert "nextjs example page3 ssr rendering fix"
Browse files Browse the repository at this point in the history
  • Loading branch information
jamuhl committed Oct 27, 2018
1 parent 236133d commit 0121834
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions example/nextjs/pages/_app.js
Expand Up @@ -31,22 +31,8 @@ if (enableSubpaths) {
// Warning: Did not expect server HTML to contain a <h1> in <div>.
// not sure - did neither find something wrong - nor seems the warning to make sense
export default class MyApp extends App {

static async getInitialProps({Component, router, ctx}) {
let pageProps = {};

if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx);
}

// initialI18nStore and initialLanguage need to be passed into NamespacesConsumer
// for any page that is not wrapped with withI18next to enable ssr localized rendering
let i18nProps = i18n.getInitialProps(ctx.req, "common");
return {pageProps, i18nProps};
}

render() {
const { Component, pageProps, i18nProps } = this.props;
const { Component, pageProps } = this.props;

return (
<Container>
Expand All @@ -55,8 +41,6 @@ export default class MyApp extends App {
ns="common"
i18n={(pageProps && pageProps.i18n) || i18n}
wait={process.browser}
initialI18nStore={i18nProps.initialI18nStore}
initialLanguage={i18nProps.initialLanguage}
>
{t => (
<React.Fragment>
Expand Down

0 comments on commit 0121834

Please sign in to comment.