Skip to content

Commit 8740a20

Browse files
committed
Add unique key to dynamically generated children
1 parent b74f65c commit 8740a20

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

static/js/components/Models.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ const ModelInfo = props => (
178178
<tr>
179179
<th>Model Type</th>
180180
<th>Hyperparameters</th>
181-
{Object.keys(props.model.metrics).map(metric => <th>{metric}</th>)}
181+
{Object.keys(props.model.metrics).map(metric =>
182+
<th style={{ textAlign: "center" }} key={`th_${metric}`}>{metric}</th>)}
182183
</tr>
183184
</thead>
184185
<tbody>
@@ -202,11 +203,11 @@ const ModelInfo = props => (
202203
</td>
203204
{
204205
Object.keys(props.model.metrics).map(metric => (
205-
<td>
206+
<td key={`td_${metric}`}>
206207
{
207208
metric == 'feature_importances' ?
208209
<FeatureImportances data={props.model.metrics[metric]} /> :
209-
props.model.metrics[metric]
210+
props.model.metrics[metric].toFixed(3)
210211
}
211212
</td>))
212213
}

0 commit comments

Comments
 (0)