From d4ee4ff8661a8bb6ce89fc36edeaa0de04a39c39 Mon Sep 17 00:00:00 2001 From: Liron Date: Fri, 16 Feb 2024 11:19:57 -0500 Subject: [PATCH] doc(issue-2259): Document react state issue (#2260) Updated README to explain on the best way to solve an issue where react state is getting cleared between pages navigations. Co-authored-by: lburrack --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index aa36b5bb..f336ec17 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,20 @@ This means that the i18n configuration file will be in the same directory as `ne **Notice** If your config `next-i18next.config.js` is not in the same directory as `next.config.js`, you must copy it manually (or by custom script). +#### Adding next-i18next incrementally + +If you are planning on incrementally add next-i18next to you project we recommended that you will pass your `next-i18next.config` to `appWithTranslation` to avoid any issues. + +i.e + +```js +import nextI18nextConfig from '../../next-i18next.config'; +//... +export default appWithTranslation(MyApp, nextI18nextConfig); +``` + +See Issue [#2259](https://github.com/i18next/next-i18next/issues/2259) for more information. + ## Notes ### Vercel and Netlify