Skip to content

fix: handle spread props for inner components in Trans (#1869)#1877

Merged
adrai merged 1 commit intoi18next:masterfrom
cellog:issue-1869-spread
Oct 23, 2025
Merged

fix: handle spread props for inner components in Trans (#1869)#1877
adrai merged 1 commit intoi18next:masterfrom
cellog:issue-1869-spread

Conversation

@cellog
Copy link
Copy Markdown
Contributor

@cellog cellog commented Oct 23, 2025

This fixes the case where we want to spread props on a component and adds test cases for both spread and for implicit true props

<Trans i18nKey="something">
  <Some {...spreadProps}>hi</Some>
</Trans>

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

Checklist (for documentation change)

  • only relevant documentation part is changed (make a diff before you submit the PR)
  • motivation/reason is provided
  • commit message and code follows the Developer's Certification of Origin

@adrai adrai merged commit 94278a7 into i18next:master Oct 23, 2025
8 checks passed
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 97.678% (+0.08%) from 97.601%
when pulling b53e6a3 on cellog:issue-1869-spread
into a5287b5 on i18next:master.

@adrai
Copy link
Copy Markdown
Member

adrai commented Oct 23, 2025

included in v16.1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants