我可以在React头盔标签内使用react-i18next trans标签吗?

问题描述 投票:0回答:1

以下代码

const x = (<Trans>Welcome</Trans>);
<helmet><title>{ `${x}` }</title></helmet>

不显示标题=欢迎。它显示标题=对象,对象

因此,我想知道我能否在react-helmet标签内使用react-i18next标签吗?

javascript reactjs i18next react-helmet
1个回答
1
投票

[头盔内不能有自定义JSX标签。它仅支持所有有效的head标签:title, base, meta, link, script, noscript, and style tags及其属性。但是,您可以使用i18n的t函数进行翻译

© www.soinside.com 2019 - 2024. All rights reserved.