Skip to content

Commit 0f27160

Browse files
Update InteractiveAtomMessenger.importable.tsx
1 parent 3a2b0ed commit 0f27160

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dotcom-rendering/src/components/InteractiveAtomMessenger.importable.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ export const InteractiveAtomMessenger = ({ id }: Props) => {
4444
);
4545

4646
useEffect(() => {
47-
const found = document.querySelector<HTMLIFrameElement>(
47+
const element = document.querySelector<HTMLIFrameElement>(
4848
`iframe[id="${id}"]`,
4949
);
50+
const found = !!element;
5051
if (!found) return;
5152

52-
setIframe(found);
53+
setIframe(element);
5354
}, [id]);
5455

5556
useEffect(() => {

0 commit comments

Comments
 (0)