score:1

Accepted answer
return <div>{dynamicPartnerList.map(function (object) {...})} </div>

score:4

if (newAllPartners != null && newAllPartners != undefined && (Object.keys(newAllPartners).length != 0)) {
    dynamicPartnerList.map(function (object) {
        randomNumber = Math.floor(Math.random() * (300 - 10000 + 1) + 1000);

        if (object.name != undefined) {
            firstLetter = object.name.charAt(0);

            if (firstLetter === lastLetter) {
                firstLetter = '';
                showImage(object.id, object.urlPicture);

                return (
                    <tbody>
                        <tr className="row clickable" key={object.id} onClick={() => this.rowClick(object.id)}>
                            <td>
                                <table>
                                    <tbody>
                                        <tr className="row">
                                            <td className="child col s4 m3 l2">
                                                <img id={object.id} height="56px" />
                                            </td>
                                            <td className="col s8 m9 l10">
                                                <table>
                                                    <tbody>
                                                        <tr>
                                                            <td className="columnwithTitleSubtile">
                                                                <p className="producerName">{object.name}</p>
                                                                <p className="subtitle">{object.countSIF} {<FormattedMessage id="navbar.slaughterhouses" />}</p>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                )
            }

            else {
                lastLetter = firstLetter;
                return (
                    <tbody>
                        <tr key={randomNumber}>
                            <td className="firstLetter">{firstLetter}</td>
                        </tr>
                    </tbody>
                )
            }
        }

        else {
            return (
                <tbody>
                    <tr>
                        <td>
                            {<FormattedMessage id="msgempty.default" />}
                        </td>
                    </tr>
                </tbody>
            )
        }
    })
} 
else{ // this was missing
    return <tbody></tbody>
}

Related Query

More Query from same tag