Skip to content
This repository was archived by the owner on Jun 10, 2019. It is now read-only.

Commit 367e94e

Browse files
committed
Make all SchoolCard component key attributes unique
1 parent 3666023 commit 367e94e

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/scenes/home/codeSchools/approvedSchools/approvedSchools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ApprovedSchools extends Component {
3535
.map(school =>
3636
(
3737
<SchoolCard
38-
key={`${Math.random()} + ${school.name}`}
38+
key={`${Math.random()} + ${school.name} + ${school.address}`}
3939
alt={school.name}
4040
schoolName={school.name}
4141
link={school.url}

src/scenes/home/codeSchools/onlineSchools/onlineSchools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class OnlineSchools extends Component {
3737
const eSchools = this.state.eSchools.map(school =>
3838
(
3939
<SchoolCard
40-
key={`${Math.random()} + ${school.name}`}
40+
key={`${Math.random()} + ${school.name} + ${school.address}`}
4141
alt={school.name}
4242
schoolName={school.name}
4343
link={school.url}

src/scenes/home/codeSchools/stateSortedSchools/stateSortedSchools.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class StateSortedSchools extends Component {
4040
if (e instanceof TypeError) {
4141
/* eslint-disable no-console */
4242
console.log('Error: Typo in code_schools.yaml on the back-end under the `state` field');
43-
console.log(e);
4443
/* eslint-disable no-console */
4544
return false;
4645
}
@@ -74,7 +73,7 @@ class StateSortedSchools extends Component {
7473
.map(school =>
7574
(
7675
<SchoolCard
77-
key={school.address}
76+
key={`${Math.random()} + ${school.name} + ${school.address}`}
7877
alt={school.name}
7978
schoolName={school.name}
8079
link={school.url}

0 commit comments

Comments
 (0)