-
Notifications
You must be signed in to change notification settings - Fork 12
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
[question]: Is there any way to use a component inside a message? #59
Comments
Hi, it is possible, in your case it would be: <Text
id='some.id'
defaultMessage='Some message with {link} in the middle.'
link={<CustomLink to='...'>link text</CustomLink>}
/> I will check, why it does not work, when we pass function as param. |
Thanks, but as I understand it requires two templates: |
Yes, it make sense. For now, you can do it with html tags, like: <Text
html
id='some.id'
defaultMessage='Some message with <a class="%css_class%" href="{url}">link text</a> in the middle.'
url='%url%'
/> Therefore you can use any html syntax inside message, but jsx syntax inside message does not supported. |
That's the case. I suppose, it might be a good feature. |
Yeah, thank you for the idea! I will research, how it can be implemented nicely, but in general I would strongly recommend avoid using any code inside translations. It creates hard connection between translations and implementation of view. |
Just curious any update on this ? ;) it would be great if we can support something similar to |
Hi,
Is there any way to use a component inside a message? Something like how it works in
react-intl
orlingui
.Thanks!
The text was updated successfully, but these errors were encountered: