Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Louiefigz/df457dc9630a8cff1a951ea1eb8567d2 to your computer and use it in GitHub Desktop.
Save Louiefigz/df457dc9630a8cff1a951ea1eb8567d2 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
class Band extends Component {
// When we are handing the click, we would ideally want to change our current
// state to remove this item. We need to call our dispatch function and include a DELETE
// type so we can impliment logic later in our manageBand.js.
handleClick(e){
e.preventDefault();
this.props.store.dispatch({
type: "DELETE_BAND",
id: this.props.band.id
})
}
render(){
return(
<div>
<li>{this.props.band.text}</li>
<button onClick={(event)=>this.handleClick(event)} >Que Que?</button>
</div>
)
}
}
export default Band;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment