Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Louiefigz/03c219d14e103e69a0bac34fe7b5eddd to your computer and use it in GitHub Desktop.
Save Louiefigz/03c219d14e103e69a0bac34fe7b5eddd to your computer and use it in GitHub Desktop.
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