fix: Avatar.onError() event is triggered twice (#24506)

This commit is contained in:
Sanonz 2020-05-27 19:25:28 +08:00 committed by GitHub
parent 84df944aaf
commit f7c34de3ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,6 +197,11 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
); );
} }
} }
// The event is triggered twice from bubbling up the DOM tree.
// see https://codesandbox.io/s/kind-snow-9lidz
delete others.onError;
return ( return (
<span <span
{...others} {...others}