Last active
October 28, 2017 20:41
-
-
Save matthieu-D/66ca4de14bc404da6c950e7c2c309d3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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