hack4impact-uiuc / 7000-languages

Helping Indigenous communities around the world teach, learn and sustain their languages
GNU General Public License v3.0
12 stars 2 forks source link

Encountered two children with the same key on the Lesson Page #181

Closed ashayp22 closed 2 years ago

ashayp22 commented 2 years ago

Describe the bug Users might get the warning, "Encountered two children with the same key on the Lesson Page." This is because there are duplicate key props of the StyledCard component on the Lesson page.

This is what the key prop currently is. It is possible for name and body to be the same for two different cards key={${element.name}${element.body}}

We should change which value is being passed into the key prop for the StyledCard component and make sure that it will remain unique, even if two vocab items have the same name and description.

To fix this bug, update the two key props in client/src/components/LanguageHome by including element._id.