我有一个处于状态的对象数组
class Foo extends Component {
state={
cluster_terminal=[
{
"terminal": "-LhP-bIu6c_u1mcCUO6Q",
"pulsa_cluster": "-LhZ_ijBuuhINBXpvLDX",
"is_default": true,
"is_actived": true,
"id_terminal_pulsa_ppob": null
},
//more item...
],
//next line of code
但是当我想在渲染器中映射它时,抛出错误Uncaught (in promise) TypeError: this.constructor is not a function
这是我在render()
内的代码
<Table compact>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Terminal</Table.HeaderCell>
<Table.HeaderCell>Cluster</Table.HeaderCell>
<Table.HeaderCell>Default</Table.HeaderCell>
<Table.HeaderCell>Actived</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
{
cluster_terminal.map((ct) => {
console.log({ct})
return <Table.Row>
<Table.call>{ct.terminal}</Table.call>
<Table.call>{ct.pulsa_cluster}</Table.call>
<Table.call>{ct.is_default}</Table.call>
<Table.call>{ct.is_actived}</Table.call>
</Table.Row>
})
}
</Table.Body>
</Table>
是因为我使用了react语义ui或preact.js错误本身,还是我的代码有问题?