The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

hettlage (136) [Avatar] Offline
I'm a bit puzzled: Don't you have to bind the methods onTitleChange, onDescriptionChange, onCreateTask and toggleForm to this in Listing 2.12?
Will Faurot (8) [Avatar] Offline
Yep, you're 100% correct that handlers like `onStatusChange` and `onTitleChange` need to have `this` bound, but instead of binding in the constructor like this:
this.onTitleChange = this.onTitleChange.bind(this)

we chose to use an early-ish stage ES2015 feature that lets us bind `this` directly in the method definitions:

class TasksPage extends Component {
  constructor(props) {
    // ...

  onTitleChange = e => {  // Where the magic happens
    this.setState({ title: });

  onDescriptionChange = e => {
    this.setState({ description: });
  // ...

Check out #5 on this list for a quick description.

Thanks for bringing this up though, I think it's a sign that we may hand wave over this in the book. Making a note to update smilie.