I have a function which I need to return a string with line breaks, or divs that will render properly
export const showPeople = (peopleArray = []) => {
let peopleString = peopleArray ? peopleArray.map((people) => {
<div>
`${people.name && people.name},
${people.last_name && people.last_name}`
</div>
}).join('') : ''
return peopleString
}
I tried with divs, without divs, with return without return, and without join and i get [Object] for each person, in this particular case an empty string
I have seen similar questions but was not able to solve my problem