How can I set element name dynamically in reactjs ? I'm using this library to show cryptocurrecy icons as a list. Using the library we can get Bitcoin icon as <Btc />
and so on. Lets say I've define an array of Cryptocurrency names(Btc, Eth, Sc etc) as a state call crypto
. Using map
function how can I set the element name dynamically ?
render(){
return(
<div>
{this.state.crypto.map( crypto => {
<h3>{crypto}</h3>
<{crypto} />
}
</div>
)
}