Skip to content

Instantly share code, notes, and snippets.

@oampo
Created September 23, 2016 12:51
Show Gist options
  • Select an option

  • Save oampo/44bda4e62689bae23cf7f6f07a372a31 to your computer and use it in GitHub Desktop.

Select an option

Save oampo/44bda4e62689bae23cf7f6f07a372a31 to your computer and use it in GitHub Desktop.

Connect the components, dispatch the actions

Rendering the state

  • In your ReactDOM.render call, wrap your components in a Provider to provide the store to connected components.
  • Connect the Board component, mapping the lists property of the state to the lists prop of the board component.
  • Check that your initial state is being rendered at this point.

Adding cards

  • Connect the List component to give you access to the dispatch prop.
  • In the List component, dispatch the addCard action when the AddForm's onAdd callback is fired.
    • You can use the card's index as its id.
  • Test out adding a new card to a list.

Adding lists

  • Connect the Board component to give you access to the dispatch prop.
  • In the Board component, dispatch the addList action when the AddForm's onAdd callback is fired.
    • You can use the list's index as its id.
  • Test out adding a new list to the board.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment