Возврат внутрь forEach
не работает.
изменить эту функцию
const getDocumentTypeForRow = id => {
companyDocumentTypes.forEach(type => {
if (type.id === id) {
console.log(type.name)
return type.name;
}
});
};
на
const getDocumentTypeForRow = id => {
return companyDocumentTypes.find(type => type.id === id).name;
};
обновить
изменить
render: rowData =>{ getDocumentTypeForRow(rowData.typeId)},
на
render: rowData => getDocumentTypeForRow(rowData.typeId),
, поскольку вы должны вернуть значение, возвращаемое из getDocumentTypeForRow
.