Skip to content

Instantly share code, notes, and snippets.

@Circuit8
Created June 22, 2016 16:18
Show Gist options
  • Save Circuit8/2bbf2cb278902e0cbbea0303fa6de5e1 to your computer and use it in GitHub Desktop.
Save Circuit8/2bbf2cb278902e0cbbea0303fa6de5e1 to your computer and use it in GitHub Desktop.
class DeleteButton extends React.Component {
render () {
if( this.props.active ){
confirm = <confirmationModal />
}
return(
<a href={this.props.url}
data-method="delete"
className="delete-button"
onClick={this.handleClick} >
<i className="fa fa-trash"/>
{confirm}
</a>
);
};
handleClick = (e) =>{
e.preventDefault
this.props.active = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment