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
bug

Comments

@pwiszowaty0
Copy link

@pwiszowaty0 pwiszowaty0 commented Mar 15, 2019

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

This comment has been minimized.

Copy link
Member

@jamuhl jamuhl commented Mar 16, 2019

Will check this on monday....

@jamuhl

This comment has been minimized.

Copy link
Member

@jamuhl jamuhl commented Mar 18, 2019

should be fixed in react-i18next@10.5.2

@pwiszowaty0

This comment has been minimized.

Copy link
Author

@pwiszowaty0 pwiszowaty0 commented Mar 18, 2019

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

@jamuhl

This comment has been minimized.

Copy link
Member

@jamuhl 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 Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.