survivejs / react-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/react/introduction/
2.02k stars 366 forks source link

[Mistake] TypeError: _this.props.onValueClick is not a function #394

Closed vjancik closed 8 years ago

vjancik commented 8 years ago

Because the activateLaneEdit handler is attached here, instead of here as:

<Editable
  className="lane-name"
  editing={lane.editing}
  value={lane.name}
  onValueClick={this.activateLaneEdit}
  onEdit={this.editName}
/>

There is an error here: Uncaught TypeError: _this.props.onValueClick is not a function

Lane name editing still works because the changes go through the store.

bebraw commented 8 years ago

onValueClick needs to become optional as the editing state is handled differently there.

Good catch! Thanks.

bebraw commented 8 years ago

There's a check in place for this case now. Thanks.