Skip to content

Commit

Permalink
fix: <Plural /> props on macro not exported
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Moreno committed Jan 26, 2021
1 parent c3b2783 commit d7e8ad7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/macro/src/macroJsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ export default class MacroJSX {
}
} else if (this.types.isTemplateLiteral(exp)) {
const tokenize = R.pipe(
// Don't output tokens without text.
// Don"t output tokens without text.
R.evolve({
quasis: R.map((text: babelTypes.TemplateElement) => {
// Don't output tokens without text.
// Don"t output tokens without text.
const value = text.value.raw
if (value === "") return null

Expand Down Expand Up @@ -273,7 +273,10 @@ export default class MacroJSX {
ID,
COMMENT,
MESSAGE,
'render',
// we remove <Trans /> react props that are not useful for translation
"render",
"component",
"components"
], true))

const token = {
Expand Down Expand Up @@ -303,7 +306,7 @@ export default class MacroJSX {
} else {
let value
if (this.types.isStringLiteral(attr.value)) {
value = attr.value.extra.raw.replace(/(["'])(.*)\1/, "$2")
value = attr.value.extra.raw.replace(/(["'])(.*)\1/, "$2")we
} else {
value = this.tokenizeChildren(attr.value)
}
Expand Down Expand Up @@ -358,7 +361,7 @@ export default class MacroJSX {

/**
* We clean '//\` ' to just '`'
*/
* */
clearBackslashes(value: string) {
return value.replace(removeExtraScapedLiterals, "`")
}
Expand Down

0 comments on commit d7e8ad7

Please sign in to comment.