1
var User = React.createClass({
render: function() {
console.log("User");
console.log(this.props);
return (
<div className="user">
<h2 className="userName">
{this.props.name}
</h2>
<img src={this.props.avatarHash} alt="" width="100" height="100" />
</div>
);
}
});
如何在屬性中附加/混合HTML? 我已經嘗試和失敗:混合HTML和{this.props.foo}
<img src="http://foo.bar/{this.props.avatarHash}" alt="" width="100" height="100" />
<img src="http://foo.bar/"{this.props.avatarHash} alt="" width="100" height="100" />