Check out example codes for "alternative image in img tag". It will help you in understanding the concepts better.

Code Example 1

<img src="https://imageurl.com" alt="Image not found" onerror="this.src='https://alternativeimageurl.com'" />

Learn ReactJs, React Native from akashmittal.com