How can I use if else inside div tags?
I want a use like here. So if customer.info is empty or -1 then it shows the code below, if not it doesn't show it
I made a few tries but couldn't.
if (this.props.customerInfo.customer === "-1") {
<TableEditColumn
showAddCommand
showEditCommand
showDeleteCommand
commandComponent={Command}
/>
}
render() {
if (!isLoaded) {
return <div>Loading</div>;
} else {
return (
<div>
<Paper>
<Grid
rows={this.state.treatmentItems}
columns={this.state.columns}
>
<EditingState
onCommitChanges={this.commitChanges}
/>
<Table />
<TableColumnResizing
defaultColumnWidths={this.state.defaultColumnWidths}
/>
<TableEditRow />
<TableEditColumn
showAddCommand
showEditCommand
showDeleteCommand
commandComponent={Command}
/>
</Grid>
</Paper>
</div>
);
}
}
Aucun commentaire:
Enregistrer un commentaire