-2

basically trying to combine some text with a link:

  const myText = `${t('privacyTxt')}` + `${<a>{t('privacyLink')}</a>}`;

result:

To learn how we process your data, visit our[object Object]

What am I missing?

CodingLittle
  • 1,761
  • 2
  • 17
  • 44

1 Answers1

4

You're trying to put JSX inside a template literal. It doesn't belong there.

If you're at the point of dealing with JSX, then everything should be done using JSX and not template literals.

const myText = <>
   {t('privacyTxt')}
   <a>
       {t('privacyLink')}
   </a>
</>;
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335