From db82f9ce6df27258e665e45bca4fd94384a62def Mon Sep 17 00:00:00 2001 From: Ilya Lebedev Date: Mon, 21 Sep 2020 06:47:58 +0300 Subject: [PATCH] [Example] with-react-intl: fix doubling messages (#17175) Because `import()` for .json files return object like this: ```json { "default": { "some": ... }, "some": ... } ``` ![image](https://user-images.githubusercontent.com/2598671/93468826-4156b200-f8f8-11ea-8e39-42df2df83057.png) --- examples/with-react-intl/pages/_app.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/with-react-intl/pages/_app.tsx b/examples/with-react-intl/pages/_app.tsx index 6bc246d015..d8ea69b8d9 100644 --- a/examples/with-react-intl/pages/_app.tsx +++ b/examples/with-react-intl/pages/_app.tsx @@ -71,7 +71,11 @@ const getInitialProps: typeof App.getInitialProps = async appContext => { App.getInitialProps(appContext), ]); - return {...(appProps as any), locale: supportedLocale, messages}; + return { + ...(appProps as any), + locale: supportedLocale, + messages: messages.default, + }; }; MyApp.getInitialProps = getInitialProps; -- GitLab