From 9a99507b986b574373b18c86649f8541a99396ac Mon Sep 17 00:00:00 2001 From: Niklas P Date: Wed, 23 Jul 2025 05:46:19 +0200 Subject: [PATCH] Update Beachball.tsx to remove duplication in strict mode (#840) in strict mode the beachball gets rendered twice --- packages/react-identicon/src/icons/Beachball.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/react-identicon/src/icons/Beachball.tsx b/packages/react-identicon/src/icons/Beachball.tsx index 4f61dafa..a2e67472 100644 --- a/packages/react-identicon/src/icons/Beachball.tsx +++ b/packages/react-identicon/src/icons/Beachball.tsx @@ -10,9 +10,12 @@ import { beachballIcon } from '@polkadot/ui-shared'; function Identicon ({ address, className = '', size, style = {} }: Props): React.ReactElement { const updateElem = useCallback( (node: HTMLDivElement): void => { - node?.appendChild( - beachballIcon(address, { isAlternative: false, size }) - ); + if (node) { + node.innerHTML = ''; + node.appendChild( + beachballIcon(address, { isAlternative: false, size }) + ); + } }, [address, size] );