Skip to content

Commit 2c1565a

Browse files
Make renderingTarget a useEffect dependency and lint fix
1 parent e588c62 commit 2c1565a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

dotcom-rendering/src/lib/useNewsletterSignupForm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type React from 'react';
55
import { useCallback, useEffect, useRef, useState } from 'react';
66
import type ReactGoogleRecaptcha from 'react-google-recaptcha';
77
import type { RenderingTarget } from '../types/renderingTarget';
8+
import { getNewslettersClient } from './bridgetApi';
89
import { lazyFetchEmailWithTimeout } from './fetchEmail';
910
import {
1011
getEffectiveMarketingOptIn,
@@ -22,7 +23,6 @@ import {
2223
import { clearSubscriptionCache } from './newsletterSubscriptionCache';
2324
import { useAuthStatus, useIsSignedIn } from './useAuthStatus';
2425
import { useBrowserId } from './useBrowserId';
25-
import { getNewslettersClient } from './bridgetApi';
2626

2727
// ---------------------------------------------------------------------------
2828
// Helpers (kept local — not part of the public API)
@@ -336,7 +336,7 @@ export const useNewsletterSignupForm = (
336336
setIsInteracted(true);
337337
});
338338
}
339-
}, [isSignedIn]);
339+
}, [isSignedIn, renderingTarget]);
340340

341341
const submitForm = useCallback(
342342
async (emailAddress: string, token: string): Promise<void> => {

0 commit comments

Comments
 (0)