<div className="bg-[#F8F8F8] flex items-center justify-center px-2 py-10">
<Image src={image} alt="course image" width={100} height={100} />
</div>
I want when image is not available due to error so replace it with dummy image how can i do that?
0
import fallbackImage from ‘./assets/dummy-image.jpg’;
import the fallback image and Conditional src:
The src attribute uses the original image. If the original image is unavailable or fails to load, the src event handler sets the src to the fallback image.
src={image || fallbackImage}