I'm using react and I'm trying to display this error message if this.state.message === 'failed'
. But I'm really not sure why this ternary operation isn't working. What am I doing wrong here?
render() {
...
<div className="row">
return (this.state.message === 'failed') ? ( =>{" "}
{
<div className="alert alert-danger" role="alert">
Something went wrong
</div>
}
)() : false; }
</div>
}
Right now its just displaying return (this.state.message === 'failed') ? ( =>
in the html
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…