Display [object Object] when I pass it an anchor as a parameter
Closed this issue · 1 comments
sebacc92 commented
Hello!
I am using this code in my app
{t('app.hello@@Hello, visit my website {{link}}', { link: <a href="https://google.com/">Google</a> })}
but that translate this:
'Hello, visit my website [object Object]'
What am I doing wrong? What is the correct way?
Thanks
robisim74 commented
You can't pass an Html element directly to the link
param, you have to use quotes:
<p dangerouslySetInnerHTML={t('app.hello@@Hello, visit my website {{link}}', { link: '<a href="https://google.com/">Google</a>' })}></p>