score:2

Accepted answer

you can simply use variable as tag (the only requirement is that variable starts with uppercase letter):

render(){
    return(
        <div>
            {this.state.crypto.map(crypto => (
                <div>
                    <h3>{crypto}</h3>
                    <crypto />
                </div>
            ))}
        </div>
    )
}

score:1

you can set the name dynamically using react.createelement function. jsx is just synthetic sugaring over the createelement function.

render() {    
 return (
  <div>
   {this.state.crypto.map(crypto => {
      const cryptoelement = react.createelement(crypto)
      return <div>
        <h3>{crypto}</h3>
        {cryptoelement}
      </div>
    })}
  </div>
 )
}

fiddle: https://jsfiddle.net/omerts/lagja2sy/

here you can find the documentation about it: https://reactjs.org/docs/react-api.html#createelement


Related Query

More Query from same tag