i18next / react-i18next

Internationalization for react done right. Using the i18next i18n ecosystem.
https://react.i18next.com
MIT License
9.18k stars 1.02k forks source link

default wrap component ? #1755

Open jonlepage opened 3 months ago

jonlepage commented 3 months ago

hi, I can't seem to find information on how to default wrap my raw string in

elements to adhere to HTML and SEO conventions.

https://react.i18next.com/latest/trans-component


is there a way to do something like ?

    <Trans
        defaultcomponent=<MyCustomDefaultWrap />
        components={{...}}
    >
        {content}
    </Trans>

image


note: the transWrapTextNodes in init config seem not work and crash. image

thanks for help

adrai commented 3 months ago

Try transWrapTextNodes: 'p'

But maybe you mean defaultTransParent: 'p'