I have a list of items (ProjectActivityList), for each item there is the Edit button. Clicking on it opens modal to edit the item. The modal accepts an ID.
var ProjectActivities = React.createClass({
onEditItem: function(id){
// I want to pass the ID to modal and open it
},
render: function(){
return (
<div>
<ProjectActivityList items={this.state.activities} onEdit={this.onEditItem}/>
<Modal />
</div>
)
}
});
How I can open the modal passing to it the ID (in onEditItem)?
this.setState({ currentId: id })?