Commit f046c0f6 authored by Frank Dai's avatar Frank Dai Committed by Tim Neutkens

Fixed the example with-react-intl, cannot read property 'locale' of undefined (#3392)

parent 54ae4323
...@@ -23,7 +23,7 @@ export default (Page) => { ...@@ -23,7 +23,7 @@ export default (Page) => {
// Get the `locale` and `messages` from the request object on the server. // Get the `locale` and `messages` from the request object on the server.
// In the browser, use the same values that the server serialized. // In the browser, use the same values that the server serialized.
const {req} = context const {req} = context
const {locale, messages} = req || window.__NEXT_DATA__.props.initialProps const {locale, messages} = req || window.__NEXT_DATA__.props
// Always update the current time on page load/transition because the // Always update the current time on page load/transition because the
// <IntlProvider> will be a new instance even with pushState routing. // <IntlProvider> will be a new instance even with pushState routing.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment