xxxxxxxxxx
import React from 'react'
const Picture = () => {
// Let's assume that getImageURL gets a URL of a picture or it returns null/undefined if it couldn't find one
const url = getImageURL()
// This approach prevents 404 errors, null or undefined URLs to display the "Image not found" icon
return <img src = {url || 'data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA='} onError = {e => e.target.style.display = 'none'}/>
}
export default Picture