diff --git a/widget/embedded/src/containers/WidgetProvider/WidgetProvider.tsx b/widget/embedded/src/containers/WidgetProvider/WidgetProvider.tsx index d60f9796c8..e51c17cea8 100644 --- a/widget/embedded/src/containers/WidgetProvider/WidgetProvider.tsx +++ b/widget/embedded/src/containers/WidgetProvider/WidgetProvider.tsx @@ -2,7 +2,7 @@ import type { PropTypes } from './WidgetProvider.types'; import type { PropsWithChildren } from 'react'; import { setSolanaSignerConfig } from '@rango-dev/signer-solana'; -import React, { useEffect } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { DEFAULT_BASE_URL, RANGO_PUBLIC_API_KEY } from '../../constants'; import useFontLoader from '../../hooks/useFontLoader'; @@ -24,7 +24,7 @@ export function WidgetProvider(props: PropsWithChildren) { } }, [fontFamily]); - useEffect(() => { + useMemo(() => { initConfig({ API_KEY: config?.apiKey || RANGO_PUBLIC_API_KEY, BASE_URL: config?.apiUrl || DEFAULT_BASE_URL,