You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you specify the key attribute as a conditional key={condition ? "key1" : "key2"}, no warning is logged.
To Reproduce
<Transi18nKey={someCondition ? "key1" : "key"}/>
Expected behavior
I don't expect that the values of that condition would be resolved but just that a warning would be logged. I have "failOnWarnings" set to true and I would want to make sure no one on my team ever did this.
FYI I am happy to submit a PR for this. Starting with an issue per the contribution guidelines.
🐛 Bug Report
If you specify the key attribute as a conditional
key={condition ? "key1" : "key2"}
, no warning is logged.To Reproduce
Expected behavior
I don't expect that the values of that condition would be resolved but just that a warning would be logged. I have "failOnWarnings" set to true and I would want to make sure no one on my team ever did this.
FYI I am happy to submit a PR for this. Starting with an issue per the contribution guidelines.
Also, if you do want me to submit a PR, would you prefer I add
SyntaxKind.ConditionalExpression
here https://github.com/i18next/i18next-parser/blob/master/src/lexers/jsx-lexer.js#L82 or change that to log a warning if any value is not aSyntaxKing.StringLiteral
?Your Environment
The text was updated successfully, but these errors were encountered: