javascript - How do I access a component's prop value from within an event handler? -
i have simple component event handler function. how access props value? doesn't epecting.
class example extends react.component { handleclick( event, id ) { console.log( id ); console.log( this.props ); }
.....
return ( <tr onclick={this.handleclick}> <th scope="row">
.....
return ( <tr onclick={this.handleclick.bind(this)}> <th scope="row">
Comments
Post a Comment