So I'm trying to return an umbrella icon if it's raining outside but all I get is [object Object] Get an umbrella, it will rain today!, not the image.
My function is here:
function rain(x){
if (x.includes("rain"))
return <img src={Umbrella} alt="wind icon" style={{ width: 50, height: 50 }} /> + " Get an umbrella, it will rain today!";
}
And the line where I call the function:
<p className={classes.info}>{rain(props.responseObj.weather[0].description)}</p>
How could I return an image from a function in React?