Skip to content

Instantly share code, notes, and snippets.

@rstudner
Created February 1, 2015 16:23
Show Gist options
  • Save rstudner/5ad410d71a077b357e1e to your computer and use it in GitHub Desktop.
Save rstudner/5ad410d71a077b357e1e to your computer and use it in GitHub Desktop.
This can't be the right way :)
var ActivityRow = React.createClass({
render: function() {
return (
<div className="activity-row">
<span className="activity-time-stamp">{this.props.activity.timestamp}</span>
<p>{this.props.activity.title}</p>
<p className="activity-detail">{this.props.activity.detail}</p>
</div>
)
}
});
var ActivityList = React.createClass({
render: function() {
var activityRows = this.props.data.map(function (activity) {
return (
<ActivityRow activity={activity}></ActivityRow>
);
});
return (
<div>{activityRows}</div> //I don't want this wrapper div.. how do I get around this sort of thing?
)
}
});
var ActivityBox = React.createClass({
render: function() {
return (
<div className="span4 incident-activity-feed">
<h4>Activity Feed</h4>
<ActivityList data={this.props.data} />
</div>
);
}
});
$(document).ready(function () {
React.render(
<ActivityBox data={fakeData.assetActivities} />,
document.getElementById('activity-feed')
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment