//импорт компонентов
import Accessible from ''
import Ambulance from ''
import Heartbeat from ''
import Hospital from ''
import HSquare from ''
import Medkit from ''
import Stethoscope from ''
import UserMd from ''
//массив названий
const serviceIcons = ['Accessible', 'Ambulance', 'Heartbeat', 'Hospital', 'HSquare', 'Medkit', 'Stethoscope', 'UserMd']
//вызов ф-и showIconsSpeciality, которая должна вывести все иконки
<div>
{
serviceIcons.map(this.showIconsSpeciality)
}
</div>
//сама ф-я showIconsSpeciality
showIconsSpeciality = (nameIcon, i) => {
return React.createElement(
'div',
{ key: i },
React.createElement(nameIcon , {
name: nameIcon,
color: '#a5a5a5',
style: {
transition: 'all .5s 0',
width: '40px'
}
})
);
}
ПРОБЛЕМА заключается в том что создается просто ЭЛЕМЕНТ в цикле , а мне нужно что б вызывался КОМПОНЕНТ в цикле. Например <Accessible .../>
На данный момент получается <accessible ...></accessible>
Помогите вывести компоненты.