I am using react intl ^2.4.0 version. I want to add link inside formatted message that gets translated as well. I am using this in combination with react cookie law
i tried to use something like:
const link = <a href="google.com">log in</a>;
const msg = `this website uses cookies ${link}`
but no luck.
const cookieMsg = (
<FormattedMessage
id="text"
defaultMessage="This website uses cookies LINK HERE."
/>
);
and in CookieBanner:
<IntlProvider locale={lang} messages={messages[lang]}>
<>
<CookieBanner
message={msg}
...
/>
</>
</IntlProvider>
Im rendering directly in app.js. Here it is:
<CookieBanner
message={cookieMsg}
acceptButtonText={cookieBtn}
privacyPolicyLinkText={cookiePrivacy}
policyLink="https://www.google.com"
showMarketingOption={false}
showStatisticsOption={false}
showPreferencesOption={false}
styles={{
optionWrapper: {
display: "none"
}
}}
/>