React-i18next: transSupportBasicHtmlNodes doesn't work with self-closing Trans

Created on 15 Mar 2019  路  4Comments  路  Source: i18next/react-i18next

Describe the bug
New feature transSupportBasicHtmlNodes allow to use simple html elements like <br/> with Trans component, but it doesn't work with Trans component without props.children

Occurs in react-i18next version
[email protected]

To Reproduce
translation json:

"welcome": "Hello <br/> <strong>World</strong>"

JSX: Trans component self-closing:

<Trans i18nKey="welcome" />

Results:
html elements was render as string

but for:

<Trans i18nKey="welcome">any valid children</Trans>

works as expected

bug

All 4 comments

Will check this on monday....

should be fixed in [email protected]

@jamuhl It's working, Thank you for your time

If you like this module don鈥檛 forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project -> there are many ways to help this project :pray:

Was this page helpful?
0 / 5 - 0 ratings