求助各位,在此先谢啦~
用的是react-i18next 和它的HOC component 并不想使用dangerouslySetInnerHTML这个方法,有什么方法hoc 里面可以输出带HTML的翻译么?
比如我现在有个key
{
"text": "My name is {{myVar}}, I come from Italy."
}
我想要在输出的时候把名字加粗
但是通过 i18next.t('text', { myVar: <strong>Tom</strong> })
;React 会自动转义成 My name is <strong>Tom</strong>, I come from Italy