missing <li> tags?
Closed this issue · 2 comments
does this section need <li> </li>
tags somewhere, or should we assume that they are in the <Message />
component?
This pattern can be combined with destructuring, JSX Spread Attributes, and other components, for some serious terseness.
> <ul>
> {arrayOfMessageObjects.map(({ id, ...message }) =>
> <Message key={id} {...message} />
> )}
> </ul>
Thanks for the observation! Without the implementation of Message
, this is confusing.
Would it make more sense to add the <li>
or change the <ul>
to a <div>
?
I'm kinda leaning toward ul
=> div
because it removes the markup concern entirely and keeps the example terse.
well, I'd vote for li
since the section is talking about drawing lists and it would remain consistent with the previous examples.
also, changed from "message" to "list" cause that made sense to me.
not sure if this example would work though, pretty new to this.
<ul>
{arrayOfListObjects.map(({ id, ...list }) =>
<li> key={id} {...list} </li>
)}
</ul>