score:2

Accepted answer

you want to pass it as a prop and set the state of the current element. by setting the state, a re-render will be performed (if necessary, which it is in this case) and so the modal will receive the new id.

var projectactivities = react.createclass({

    onedititem: function(id){
        // i want to pass the id to modal and open it
        this.setstate({editingid: id});
    },

    render: function(){
        return (
           <div>
               <projectactivitylist items={this.state.activities} onedit={this.onedititem}/>
               <modal id={this.state.editingid} />
           </div>
        )    
    }    
});

Related Query

More Query from same tag