refactor(avatar): simplify code (#42402)

pull/42403/head^2
Alex 2 years ago committed by GitHub
parent 26590f6b35
commit 8d36dde9b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -80,13 +80,11 @@ const InternalAvatar: React.ForwardRefRenderFunction<HTMLSpanElement, AvatarProp
setScale(1);
}, [props.src]);
React.useEffect(() => {
setScaleParam();
}, [props.gap]);
React.useEffect(setScaleParam, [props.gap]);
const handleImgLoadError = () => {
const { onError } = props;
const errorFlag = onError ? onError() : undefined;
const errorFlag = onError?.();
if (errorFlag !== false) {
setIsImgExist(false);
}

Loading…
Cancel
Save