I try to do if else statement by checking if the photo property has item, but failed with below code, need help, I don't know what is wrong. The snytax look fine to me.
render() {
return ( < p > other dom < /p>
< div className = "photo_upload" > {
item.photos.length > 0 ?
< img src = {
item.photos[1]
}/ > : < button className = "btn btn-lg btn-primary" > Browse < /button> }< /div >
< p > more dom < /p>
)
}