首页 > 解决方案 > 将 react-intl 与 react-table 集成

问题描述

我在react-intl整个应用程序中使用翻译。我现在正在尝试通过react-table以下方式使用已翻译的消息作为表的标题:

    {
    Header: <FormattedMessage id="users.user" defaultMessage="User" />,
    accessor: 'role',
},

但我收到以下错误消息:

×

错误:需要列 ID(或字符串访问器)!

标签: javascriptreactjsreact-tablereact-intl

解决方案


您可以尝试改用intl.formatMessageAPI。


推荐阅读