Skip to content

Commit 20eb52c

Browse files
committed
Add unique key to dynamically generated children
1 parent ff300a1 commit 20eb52c

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
@@ -179,7 +179,8 @@ const ModelInfo = props => (
179179
<tr>
180180
<th>Model Type</th>
181181
<th>Hyperparameters</th>
182-
{Object.keys(props.model.metrics).map(metric => <th>{metric}</th>)}
182+
{Object.keys(props.model.metrics).map(metric =>
183+
<th style={{ textAlign: "center" }} key={`th_${metric}`}>{metric}</th>)}
183184
</tr>
184185
</thead>
185186
<tbody>
@@ -203,11 +204,11 @@ const ModelInfo = props => (
203204
</td>
204205
{
205206
Object.keys(props.model.metrics).map(metric => (
206-
<td>
207+
<td key={`td_${metric}`}>
207208
{
208209
metric == 'feature_importances' ?
209210
<FeatureImportances data={props.model.metrics[metric]} /> :
210-
props.model.metrics[metric]
211+
props.model.metrics[metric].toFixed(3)
211212
}
212213
</td>))
213214
}

0 commit comments

Comments
 (0)