fix: widget defaultChainId (#6012)

This commit is contained in:
eddie 2023-02-22 14:14:12 -08:00 committed by GitHub
parent 1845cb3b7b
commit a2271ba428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,7 +57,7 @@ export default function Widget({
onDefaultTokenChange,
onReviewSwapClick,
}: WidgetProps) {
const { connector, provider } = useWeb3React()
const { connector, provider, chainId } = useWeb3React()
const locale = useActiveLocale()
const theme = useWidgetTheme()
const { inputs, tokenSelector } = useSyncWidgetInputs({
@ -168,7 +168,7 @@ export default function Widget({
locale={locale}
theme={theme}
width={width}
// defaultChainId is excluded - it is always inferred from the passed provider
defaultChainId={chainId}
onConnectWalletClick={onConnectWalletClick}
provider={provider}
onSwitchChain={onSwitchChain}