I am trying to add a username in my anchor tag's href property.
My Code is,
var Name = React.createClass({
render: function() {
return (
<div>
<a href="www.example.com/"+ { this.props.username} +"" className="post-title">{this.props.name}</a><br />
</div>
);
}
});
But, I am getting an error saying undefined token + near that href property. I think this is due to I am trying to add it in render method. So, is there any other approach?
Thank you..
Remove the +. It should be:
<a href={"www.example.com/" + this.props.username} ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With