Javascript 使用变量值返回HTML

Javascript 使用变量值返回HTML,javascript,reactjs,concatenation,Javascript,Reactjs,Concatenation,如何连接图标和电话号码并返回值 phone = () =>{ let mapvalue = this.props.mapvalue return <i class='fa fa-map-marker'></i> mapvalue } render() { return ( {this.phone()} ) } phone=()=>{ 让mapvalue=this.props.mapvalue 返回映射值 } r

如何连接
图标和电话号码并返回值

phone = () =>{
     let mapvalue = this.props.mapvalue
     return <i class='fa fa-map-marker'></i> mapvalue  
}

render() {
    return (
      {this.phone()}
    )
}
phone=()=>{
让mapvalue=this.props.mapvalue
返回映射值
}
render(){
返回(
{this.phone()}
)
}

React.Fragment仅在React v.16或更高版本上可用

render () {
  return (
     <React.Fragment>
       <i class='fa fa-map-marker'></i>{this.props.mapvalue}
     </React.Fragment>
  )
}
render(){
返回(
{this.props.mapvalue}
)
}

将其包装成
span
?类似这样:
return({mapvalue})。或者,如果您使用的是React v.16.2,则可以使用
+