Skip to content

Instantly share code, notes, and snippets.

@nerdic-coder
Created April 24, 2018 20:32
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 nerdic-coder/a064ea76d815d946c270510201f65c74 to your computer and use it in GitHub Desktop.
Save nerdic-coder/a064ea76d815d946c270510201f65c74 to your computer and use it in GitHub Desktop.
selected hero condition
{this.selectedHero ? (
<div>
<h2>{ this.selectedHero.name.toUpperCase() } Details</h2>
<div><span>id: </span>{this.selectedHero.id}</div>
<div>
<label>name:
<input type="text" value={this.selectedHero.name} onInput={(event) => this.handleChangeName(event)} placeholder="name" />
</label>
</div>
</div>
) : (
<p>Select a hero!</p>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment