Do not pass empty string as img src
Raises the following error:
"An empty string ("") was passed to the src attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to src instead of an empty string"
This commit is contained in:
@@ -67,9 +67,9 @@ export const SpinnerImage = forwardRef(
|
|||||||
|
|
||||||
const showMissingImageIcon = !src.length;
|
const showMissingImageIcon = !src.length;
|
||||||
|
|
||||||
const [imageSourceUrl, setImageSourceUrl] = useState('');
|
const [imageSourceUrl, setImageSourceUrl] = useState<string>();
|
||||||
const [imgLoadRetryKey, setImgLoadRetryKey] = useState(0);
|
const [imgLoadRetryKey, setImgLoadRetryKey] = useState(0);
|
||||||
const [isLoading, setIsLoading] = useState<boolean | undefined>(undefined);
|
const [isLoading, setIsLoading] = useState<boolean>();
|
||||||
const [hasError, setHasError] = useState(false);
|
const [hasError, setHasError] = useState(false);
|
||||||
const [isVisible, setIsVisible] = useState(false);
|
const [isVisible, setIsVisible] = useState(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user