diff --git a/packages/macro/src/macroJsx.test.ts b/packages/macro/src/macroJsx.test.ts index 47abf0111..8c6e4bf16 100644 --- a/packages/macro/src/macroJsx.test.ts +++ b/packages/macro/src/macroJsx.test.ts @@ -139,6 +139,34 @@ describe("jsx macro", () => { }) }) + it("plural with key should be omitted", () => { + const macro = createMacro() + const exp = parseExpression( + `` + ) + const tokens = macro.tokenizeChoiceComponent(exp) + expect(tokens).toEqual({ + type: "arg", + name: "count", + value: expect.objectContaining({ + name: "count", + type: "Identifier", + }), + format: "plural", + options: { + "=0": "No books", + one: "# book", + other: "# books", + }, + }) + }) + it("plural with template literal", () => { const macro = createMacro() const exp = parseExpression( diff --git a/packages/macro/src/macroJsx.ts b/packages/macro/src/macroJsx.ts index c66466018..506d2e487 100644 --- a/packages/macro/src/macroJsx.ts +++ b/packages/macro/src/macroJsx.ts @@ -273,6 +273,7 @@ export default class MacroJSX { ID, COMMENT, MESSAGE, + "key", // we remove react props that are not useful for translation "render", "component",