Created
May 22, 2017 13:28
-
-
Save Louiefigz/df457dc9630a8cff1a951ea1eb8567d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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