diff --git a/packages/react-hooks/src/useFavorites.ts b/packages/react-hooks/src/useFavorites.ts index cf82f26f0c..d4f4147e2a 100644 --- a/packages/react-hooks/src/useFavorites.ts +++ b/packages/react-hooks/src/useFavorites.ts @@ -8,7 +8,7 @@ import { useCacheKey } from './useCacheKey'; // hook for favorites with local storage export function useFavorites (storageKeyBase: string): [string[], (address: string) => void] { const [getCache, setCache] = useCacheKey(storageKeyBase); - const [favorites, setFavorites] = useState(getCache() || []); + const [favorites, setFavorites] = useState(() => getCache() || []); const toggleFavorite = useCallback( (address: string): void => setFavorites(