Reactjs 常规反应表对物料的反应

Reactjs 常规反应表对物料的反应,reactjs,material-table,Reactjs,Material Table,如何从数组向材质表中添加数据 我有下表: <table className="table"> <thead> <tr> <th>Text1</th> <th>Text2</th> <th>text3 Comb</th> </tr> <

如何从数组向材质表中添加数据

我有下表:

<table className="table">
    <thead>
        <tr>
            <th>Text1</th>
            <th>Text2</th>
            <th>text3 Comb</th>
        </tr>
    </thead>
    <tbody>
        {arr.map((values, index) => {
            const textComb = `${values.text1}, ${values.text2}`;
            return (
                <tr key={index}>
                    <td>{values.text1}</td>
                    <td>{values.text2}</td>
                    <td>{textComb}</td>
                    <td></td>
                </tr>
            )
        })}
    </tbody>
</table>

文本1
文本2
text3梳子
{arr.map((值,索引)=>{
常量textComb=`${values.text1},${values.text2}`;
返回(
{values.text1}
{values.text2}
{textComb}
)
})}
我有太多的数据,所以我尝试使用MaterialTable来进行搜索、排序和分页选项

<MaterialTable
    columns={[
        {title: 'Text1', field: 'text1'},
        {title: 'Text2', field: 'text2'},
        {title: 'Text3', field: 'text3'}
    ]}
    data={
        arr((values, index) => {
            {
               // I'm confused here
            }
        })
    }
/>
{
{
//我在这里感到困惑
}
})
}
/>
试试这个-

const createData = item => ({
    text1: item.text1,
    text2: item.text2,
    text3: `${item.text1}, ${item.text2}`
});

const data = arr.map(item => createData(item));

检查此处的演示-

它返回
TypeError:_this.props.data(…)。然后它不是一个函数