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
this.state.message === \'failed\'
Given the above answers, you can also directly return a ternary expression from return() in your render() like this
return()
render()
return condition? this.function1(): this.function2();
and inside function1() and function2() you can return your views.