Use object IDs instead of array indices as keys

This commit is contained in:
2020-01-18 01:36:53 +00:00
parent cb8ac3cf63
commit 08bd52704b
9 changed files with 23 additions and 22 deletions
+3 -3
View File
@@ -25,8 +25,8 @@ function ClassTable(props) {
<Table.Body>
{classes.length ?
classes.map((x, i) =>
<Table.Row key={i}>
classes.map(x =>
<Table.Row key={x.id}>
<Table.Cell>{x.course_name}</Table.Cell>
<Table.Cell>
<Link to={'/classes/'+x.id}>
@@ -182,7 +182,7 @@ export function ClassDetail(props) {
{(isAdmin(user) || clazz.instructor === user.id) &&
<Segment padded>
<InstructorClassAttendance clazz={clazz} {...props} />
<InstructorClassAttendance clazz={clazz} refreshClass={refreshClass} {...props} />
</Segment>
}