0
votes

index.js:1 Warning: Failed prop type: Invalid prop value of type object supplied to DataTable, expected array. in DataTable

render() { return (

    <DataTable value={this.state.ilac} selectionMode="single" selection={this.state.selectedIlac} onSelectionChange={e => this.setState({ selectedIlac: e.value })} >
      <Column field="id" header="ID"></Column>
      <Column field="ilacAdi" header="İLAÇ ADI"></Column>
    </DataTable>
  </Panel>
);

}

2

2 Answers

0
votes

This is a warning from validating your DataTable component's prop value (this.state.ilac).

The Datatable expects an array but this.state.ilac is actually an object.

try Object.values(this.state.ilac).

-1
votes

maalesef olmadı.Teşekkürler cevap için