Commit 7327c4cb authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix children not having keys in map

parent 8368f1ef
...@@ -144,21 +144,22 @@ const Event = (props) => { ...@@ -144,21 +144,22 @@ const Event = (props) => {
}).filter(item => item) }).filter(item => item)
.map((list) => { .map((list) => {
while (list.length < 3) { while (list.length < 3) {
list.push({}); list.push({ member: null });
} }
const key = list[0].member + list[1].member + list[2].member;
return ( return (
<View style={styles.registrationsRow}> <View key={key} style={styles.registrationsRow}>
{list.map((reg, i) => { {list.map((reg, i) => {
const style = i === 1 ? styles.registrationsItemMargin : const style = i === 1 ? styles.registrationsItemMargin :
styles.registrationsItem; styles.registrationsItem;
if (reg.name) { if (reg.name) {
return ( return (
<MemberView member={reg} style={style} /> <MemberView key={key + i.toString()} member={reg} style={style} />
); );
} }
return ( return (
<View style={style} /> <View key={key + i.toString()} style={style} />
); );
})} })}
</View> </View>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment