From 08c7b3d0eb2ced622cdd3c4d14a3958ac8161cb8 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 21 Sep 2022 12:20:18 +0200
Subject: fix(types): add custom types to pageProps with translation

---
 src/pages/_app.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/pages/_app.tsx')

diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 5bc9f85..ec5dab7 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -11,13 +11,14 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
   const { locale, defaultLocale } = useRouter();
   const appLocale: string = locale || settings.locales.defaultLocale;
   const getLayout = Component.getLayout ?? ((page) => page);
+  const { translation, ...componentProps } = pageProps;
 
   return (
     <AckeeProvider domain={settings.ackee.url} siteId={settings.ackee.siteId}>
       <IntlProvider
         locale={appLocale}
         defaultLocale={defaultLocale}
-        messages={pageProps.translation}
+        messages={translation}
       >
         <ThemeProvider
           defaultTheme="system"
@@ -25,7 +26,7 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
           enableSystem={true}
         >
           <PrismThemeProvider>
-            {getLayout(<Component {...pageProps} />, {})}
+            {getLayout(<Component {...componentProps} />, {})}
           </PrismThemeProvider>
         </ThemeProvider>
       </IntlProvider>
-- 
cgit v1.2.3

