-1
I want to render an image only if my object has the "happy" property, so play the image I want only if this is the string. My object is an API Example:
api = {
type: "happy"
}
someFunction(){
return({api.type[0] === "happy"? (<img src={happy.png} />) : (<img src{sad.png}/>)"})
}
Property (key) or value
"happy"
? What you implied in your question was whether an object has something like{ happy: "algum valor..." }
.– Cmte Cardeal