Skip to content

Commit

Permalink
pageProps may be undefined on strange setups #2109
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Mar 8, 2023
1 parent 2a5e8e0 commit 87bcb58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 13.2.2

- pageProps may be undefined on strange setups [#2109](https://github.com/i18next/next-i18next/issues/2109)"

## 13.2.1

- types: fix serverSideTranslations args [#2104](https://github.com/i18next/next-i18next/pull/2104)"
Expand Down
2 changes: 1 addition & 1 deletion src/appWithTranslation.tsx
Expand Up @@ -24,7 +24,7 @@ export const appWithTranslation = <Props extends NextJsAppProps>(
const AppWithTranslation = (
props: Props & { pageProps: Props['pageProps'] & SSRConfig }
) => {
const { _nextI18Next } = props.pageProps
const { _nextI18Next } = props.pageProps || {} // pageProps may be undefined on strange setups, i.e. https://github.com/i18next/next-i18next/issues/2109
let locale: string | undefined =
_nextI18Next?.initialLocale ?? props?.router?.locale
const ns = _nextI18Next?.ns
Expand Down

0 comments on commit 87bcb58

Please sign in to comment.