Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.