javascript - 将 react-intl 与 react-table 集成
问题描述
我在react-intl
整个应用程序中使用翻译。我现在正在尝试通过react-table
以下方式使用已翻译的消息作为表的标题:
{
Header: <FormattedMessage id="users.user" defaultMessage="User" />,
accessor: 'role',
},
但我收到以下错误消息:
×
错误:需要列 ID(或字符串访问器)!
解决方案
您可以尝试改用intl.formatMessage
API。
推荐阅读
- lua - 如何连接两个变量
- java - 使用多个 Spring 配置文件运行 Spring Boot 应用程序
- powershell - 如何使用 PowerShell 截断二进制文件的结尾超过已知地址?
- php - 复杂算法
- intellij-idea - 阻止 PhpStorm 在文件打开时将行尾从 LF 更改为 CRLF
- gradle - 从 v 4.10.3 迁移到 6.8 时,Gradle“未找到插件 [id:'com.gradle.build-scan',版本:'1.16']”
- r - 为每个组 ID 创建所有可能的非 NA 值组合
- asp.net - Sustainsys SAML - 从 IDP (Okta) 检索断言时出现问题
- r - 汇总数据时丢失 R 因子组织 (dplyr)
- android - 创建 AnimatedTextInput 会导致键盘立即关闭