I am new around here. Doing my first own project with React, I am stuck to achieve this. After mapping a list using .map(), how can I have multiple lists split? I want them to be split by the first letter on each new <ul>, regardless the number of titles. Some titles have more than 5 or 10, for each letter. Some are not even showed, because there are no titles with that letter.
My code
<ul>
{list.map((i) => (
<li>
{i.title}
</li>
))}
</ul>
Result
<ul>
<li>title aa</li>
<li>title ab</li>
<li>title ac</li>
<li>title ba</li>
<li>title bb</li>
<li>title bc</li>
<li>title ca</li>
<li>title cb</li>
<li>title cc</li>
…
</ul>
Desired
<ul>
<li>title aa</li>
<li>title ab</li>
<li>title ac</li>
</ul>
<ul>
<li>title ba</li>
<li>title bb</li>
<li>title bc</li>
</ul>
<ul>
<li>title ca</li>
<li>title cb</li>
<li>title cc</li>
</ul>
…
Thanks for any help and possible solution.
<ul>. Sorry I didn't make it clear in my question. I apologize for it. Thanks.