Skip to content

Commit 48e1d43

Browse files
authored
Remove invalid react property i18n config (#54)
## Ticket resolves #51 ## Changes Removed the `react` property from the `i18n` property in `next-i18next.config.json`. ## Context for reviewers When running the build, prior to this change, the output would show: ``` warn - Invalid next.config.js options detected: - The value at .i18n has an unexpected property, react, which is not in the list of allowed properties (defaultLocale, domains, localeDetection, locales). See more info here: https://nextjs.org/docs/messages/invalid-next-config ``` The problematic config looked like this: ``` react: { // Add support for <em>. // See https://react.i18next.com/latest/trans-component#using-for-less-than-br-greater-than-and-other-simple-html-elements-in-translations-v-10-4-0 transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p", "em"], }, ``` I'm not aware of a good reason for that setting to be set generally in the template; the link in the comment was outdated, so the anchor it tried to connect to no longer exists, but at the top of that page, it says "the truth is: in most cases you don't even need it" in reference to the `Trans` component the `transKeepBasicHtmlNodesFor` setting connects to. There may be reason for an individual application to use that setting, but I don't think the template needs to have it by default, and either way, the option was being set improperly anyway, so I opted to remove the `react` property altogether. ## Testing Ran `npm run test` and `npm run dev` and everything seems to work as normal. Running `npm run build` no longer shows the error message referenced in the issue.
1 parent aac52e9 commit 48e1d43

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

app/next-i18next.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ module.exports = {
22
i18n: {
33
defaultLocale: "en",
44
locales: ["en", "es"],
5-
react: {
6-
// Add support for <em>.
7-
// See https://react.i18next.com/latest/trans-component#using-for-less-than-br-greater-than-and-other-simple-html-elements-in-translations-v-10-4-0
8-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p", "em"],
9-
},
105
},
116
// Locale resources are loaded once when the server is started, which
127
// is good for production but not ideal for local development. Show

0 commit comments

Comments
 (0)