Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch4 / KanbanBoardContainer.js - Two .bind() needed #4

Closed
dxps opened this issue Feb 7, 2016 · 2 comments
Closed

ch4 / KanbanBoardContainer.js - Two .bind() needed #4

dxps opened this issue Feb 7, 2016 · 2 comments

Comments

@dxps
Copy link

dxps commented Feb 7, 2016

Hi Cássio,

A small update at the end of KanbanBoardContainer.js on chapter 4 is needed.
In cardCallbacks prop, only persistCardDrag contains .bind(this) at the end.

As such, moving a card will throw the standard error of 'cards is undefined', since the calling context is wrong. So, KanbanBoardContainer.js should end like this:

    render() {

        return ( <KanbanBoard
                      cards={this.state.cards}
                      taskCallbacks={{ ... }}
                      cardCallbacks={{
                        updateStatus: this.updateCardStatus.bind(this),
                        updatePosition: this.updateCardPosition.bind(this),
                        persistCardDrag: this.persistCardDrag.bind(this)
                      }}
                  />
        )
    }

}

export default KanbanBoardContainer;

Last, but not least, thank you very much for the book! :-)

@cassiozen
Copy link
Contributor

Thanks for the feedback, and I'm glad you're enjoying it.

Wanna make a pull request? If you don't feel like doing so, I will update asap.

@dxps
Copy link
Author

dxps commented Feb 14, 2016

I hope it's ok. You may find here the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants