Added missing key attributes to the table rows.

feature/appm-store/pbac
Menaka Jayawardena 7 years ago
parent 9ce111b724
commit e32b6d167c

@ -161,6 +161,6 @@ class BaseLayout extends Component {
BaseLayout.propTypes = { BaseLayout.propTypes = {
children: PropTypes.element children: PropTypes.element
} };
export default withRouter(BaseLayout); export default withRouter(BaseLayout);

@ -88,7 +88,8 @@ class DataTable extends Component {
adjustForCheckbox={ false }> adjustForCheckbox={ false }>
<TableRow> <TableRow>
{headers.map((header) => { {headers.map((header) => {
return (<DataTableHeader style={{display: 'flex'}} key={header.id} header={header}/>) return (<DataTableHeader key={header.data_id}
style={{display: 'flex'}} header={header}/>)
} }
)} )}
</TableRow> </TableRow>

@ -61,7 +61,7 @@ class DataTableHeader extends Component {
} }
return ( return (
<TableHeaderColumn style={{paddingLeft: '0px'}} key={this.props.header.id}> <TableHeaderColumn key={this.props.header.id} style={{paddingLeft: '0px'}} >
{headerCell} {headerCell}
</TableHeaderColumn> </TableHeaderColumn>
); );

@ -47,13 +47,13 @@ class DataTableRow extends Component {
render() { render() {
const {dataItem} = this.state; const {dataItem} = this.state;
return ( return (
<TableRow onClick={this._handleClick.bind(this)} > <TableRow key={this.props.key} onClick={this._handleClick.bind(this)} >
{Object.keys(dataItem).map((key) => { {Object.keys(dataItem).map((key) => {
if (key !== 'id') { if (key !== 'id') {
return <TableRowColumn style={{alignItems: 'center'}} return <TableRowColumn style={{alignItems: 'center'}}
key={key}>{dataItem[key]}</TableRowColumn> key={key}>{dataItem[key]}</TableRowColumn>
} else { } else {
return <TableRowColumn/> return <TableRowColumn key={key}/>
} }
} )} } )}

Loading…
Cancel
Save