I am using a movie API to get images and I am trying to have an alt in case the image does not appear but I want the broken img icon to not show up either. There has to be a solution for that.
//this is my attempted solution the oneerror does not work and the broken img icon appears
<img key={movie.id} src={"https://image.tmdb.org/t/p/w185/" + movie.poster_path} alt="No image listed" onerror="this.style.display='none'" />