Created
May 22, 2017 13:26
-
-
Save Louiefigz/03c219d14e103e69a0bac34fe7b5eddd 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'; | |
import Band from './Band'; | |
class Bands extends Component { | |
render() { | |
const bands = this.props.store.getState().bands.map((band, index) => { | |
return <Band key={index} band={band} store={this.props.store} /> | |
}) | |
//See how we are passing in this.props.store | |
// We are again making another child component have access to the createStore functions. | |
// Becasue we want to be able to delete items from our state, we are going make a dispatch | |
// function call that removes an item from our master state. | |
return( | |
<ul> | |
{bands} | |
</ul> | |
); | |
} | |
}; | |
export default Bands; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment