'How to show placeholder image if image link dosn't exist react-js?

I am using links to show images. If a user gives an invalid image link that doesn't exist or can't be accessed how can I show a placeholder image?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source