Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active October 28, 2017 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/66ca4de14bc404da6c950e7c2c309d3d to your computer and use it in GitHub Desktop.
Save matthieu-D/66ca4de14bc404da6c950e7c2c309d3d to your computer and use it in GitHub Desktop.
render() {
let todoTemplate;
if (!this.isEditable) {
todoTemplate = <div>
{this.value}
<button onClick = {this.removeThisTodo}>
X
</button>
</div>
} else {
todoTemplate = <div>
<input value={this.value} onKeyDown={this.handleKeyDown} />
</div>
}
return (
<li onDblClick= {this.toggleEdition}>
{todoTemplate}
</li>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment