Skip to content

Commit

Permalink
Update: add keys to iterated components
Browse files Browse the repository at this point in the history
  • Loading branch information
mori8 committed Mar 5, 2022
1 parent f2e75ff commit f7352cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions react-native/screens/SearchResultScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export default function SearchResultScreen(props: SearchResultScreenProps) {
return (
<View style={styles.container}>
<Swiper>
{notice && notice.notices.notice_body.length > 0 && notice.notices.notice_body.map(notice =>
<ImageBackground style={styles.container} resizeMode="cover" imageStyle={{ opacity: 0.5 }} source={{ uri: imageUri }}>
{notice && notice.notices.notice_body.length > 0 && notice.notices.notice_body.map((notice, index) =>
<ImageBackground style={styles.container} resizeMode="cover" imageStyle={{ opacity: 0.5 }} source={{ uri: imageUri }} key={"ib_" + index}>
<SwipeUpDown
itemMini={
<BottomDrawer
Expand Down
4 changes: 2 additions & 2 deletions react-native/screens/SearchScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ export default function SearchScreen({ navigation }: Navigation) {
value={search}
/>
<Text style={styles.smallDescription}>RESULTS</Text>
{filteredNotices.map(notice =>
<SearchedNotice date={notice.date} summariedNotices={notice.notices.total_results}/>
{filteredNotices?.map((notice, index) =>
<SearchedNotice date={notice.date} summariedNotices={notice.notices.total_results} key={"nt_" + index}/>
)}
</View>
);
Expand Down

0 comments on commit f7352cb

Please sign in to comment.