Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transSupportBasicHtmlNodes doesn't work with self-closing Trans #790

Closed
pwiszowaty0 opened this issue Mar 15, 2019 · 4 comments
Closed

transSupportBasicHtmlNodes doesn't work with self-closing Trans #790

pwiszowaty0 opened this issue Mar 15, 2019 · 4 comments
Labels

Comments

@pwiszowaty0
Copy link

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
react-i18next@10.5.1

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

@jamuhl jamuhl added the bug label Mar 15, 2019
@jamuhl
Copy link
Member

jamuhl commented Mar 16, 2019

Will check this on monday....

@jamuhl
Copy link
Member

jamuhl commented Mar 18, 2019

should be fixed in react-i18next@10.5.2

@pwiszowaty0
Copy link
Author

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

@jamuhl
Copy link
Member

jamuhl commented Mar 18, 2019

If you like this module don’t 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 🙏

@jamuhl jamuhl closed this as completed Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants