React - to concatenate variable and HTML strings

0 votes
43 views
added Oct 25 in React by lcjr First Warrant Officer (9,190 points)
class CoworkingMainTopDesktop extends React.Component {
  render() {
    const CoworkingAsset = 'https://yoursite.com/page/coworking/images/';
    return (
      <button className="loc-button">
        <img src={CoworkingAsset + 'city.png'} />
        KL
      </button>
    );
  }
}

export default CoworkingMainTopDesktop;

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...