我想知道一些事情。
假设我有一个组件并且我想访问该t
值。我是否必须将其连接到 redux。由于使用react-i18next
我也在使用我i18next
不能只是这样做:
import i18next from 'i18next'
class Comp extends Component {
render() {
return <Text>{i18next.t('space')}</Text>
}
}
或者这样做有什么缺点?我的翻译似乎仍然有效,但肯定有缺点吗?我猜只有当语言环境发生变化时它才会看到更新?还要别的吗?
谢谢。