Skip to content

Commit 1d327b6

Browse files
authored
Fix radix warning for switch network button ref (#2935)
1 parent 8e0a3ce commit 1d327b6

File tree

1 file changed

+11
-8
lines changed
  • packages/thirdweb/src/react/web/ui/ConnectWallet

1 file changed

+11
-8
lines changed

packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,20 @@ export const ConnectedWalletDetails: React.FC<{
183183
const isNetworkMismatch =
184184
props.chain && walletChain && walletChain.id !== props.chain.id;
185185

186+
// Note: Must wrap the `detailsButton.render` and `SwitchNetworkButton` in a fragment to avoid warning from radix-ui
186187
const trigger = props.detailsButton?.render ? (
187-
<div>
188+
<>
188189
<props.detailsButton.render />
189-
</div>
190+
</>
190191
) : props.chain && isNetworkMismatch ? (
191-
<SwitchNetworkButton
192-
style={props.switchButton?.style}
193-
className={props.switchButton?.className}
194-
switchNetworkBtnTitle={props.switchButton?.label}
195-
targetChain={props.chain}
196-
/>
192+
<>
193+
<SwitchNetworkButton
194+
style={props.switchButton?.style}
195+
className={props.switchButton?.className}
196+
switchNetworkBtnTitle={props.switchButton?.label}
197+
targetChain={props.chain}
198+
/>
199+
</>
197200
) : (
198201
<WalletInfoButton
199202
type="button"

0 commit comments

Comments
 (0)