How should i pass the relative url to my ReactJs component from a asp.net mvc 5 project?
Sample URL:
<img src="~/Content/themes/base/images/DocumentBase.png" />
sample component:
var ImageViewer = React.createClass({
render: function () {
return (
<div onClick={this.clickHandler}>
<img src={this.props.src} />
</div>
);
},
clickHandler: function () {
this.props.onClick(this.props.ref);
}
});
From server I am using Reactjs.Net therefore my html
<div class="list-group">
@Html.React("ImageViewer", new
{
src = imgUrl
})
</div>