I have a condition look like below
{finishedTodos ? <ListItem button divider className={classes.finishCategory} > <ArrowForward className={classes.checkIcon} /> <ListItemText primary={`Finished ${finishedTodos.length}`} style={{color:"tomato"}}/> </ListItem> : null } //--------------------------------------------- {finishedTodos.map((todo) =>( <ListItem button divider> <CheckCircle className={classes.checkIcon} /> <ListItemText primary={todo.title} style={{textDecoration:"line-through",color:"gray"}} /> </ListItem> ))} so right now what I want to do is I Want to combine these two , and when I tried to put {finishedTodos.map... below the </ListItem>,it reported ": expected" , so I think there's something wrong with formatting , do anyone know how to solve this ?
&&operator for the first condition.{finishedTodos && <YourCompoents... /> }<><ListItem>...{mapcode}</>).{finishedTodos.map((todo) =>is not in same escope. Try if - else if and else