commit f12181eb118d3ea4abea8db380bdcc360f809f11 parent 7b7dde43c368fb23adc9577cfdda2c89b872150d Author: Yohanes Bandung <bandungpenting@gmail.com> Date: Wed, 14 Aug 2019 18:43:06 +0700 refactor(ContentList) => use Array.mapi Diffstat:
| M | src/components/ContentList.re | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/components/ContentList.re b/src/components/ContentList.re @@ -48,15 +48,15 @@ type listContent = { [@react.component] let make = (~content: array(listContent)) => { let contentMapped = - Array.map( - (item: listContent) => { + Array.mapi( + (key, item: listContent) => { let listPointType = switch (item.variant) { | Progress => Styles.pProgress | Done => Styles.pDone | Default => Styles.pDefault }; - <li> <p className=listPointType> {item.text} </p> </li>; + <li key=string_of_int(key)> <p className=listPointType> {item.text} </p> </li>; }, content, );