diff --git a/src/lib/withIntl.js b/src/lib/withIntl.js index 90b831fc0ff..578270d8121 100644 --- a/src/lib/withIntl.js +++ b/src/lib/withIntl.js @@ -1,5 +1,5 @@ -import React, {Component} from 'react' -import {IntlProvider, addLocaleData, injectIntl} from 'react-intl' +import React, { Component } from 'react' +import { IntlProvider, addLocaleData, injectIntl } from 'react-intl' import 'intl'; import 'intl/locale-data/jsonp/en.js'; // for old browsers without window.Intl @@ -27,8 +27,8 @@ export default (Page) => { // Get the `locale` and `messages` from the request object on the server. // In the browser, use the same values that the server serialized. - const {req} = context - const {locale, messages} = req || window.__NEXT_DATA__.props + const { req } = context; + const { locale, messages } = req || window.__NEXT_DATA__.props.pageProps; // Always update the current time on page load/transition because the // will be a new instance even with pushState routing.