Skip to content

Commit af1ad6b

Browse files
Adjust type check on iframe container in InteractiveAtomMessenger
Co-Authored-By: Jonathon Herbert <[email protected]>
1 parent d89b92e commit af1ad6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const interactiveMessageSchema = variant('kind', [
3131
* It needs to send information to an adjoining `InteractiveAtom`
3232
*/
3333
export const InteractiveAtomMessenger = ({ id }: Props) => {
34-
const [container, setContainer] = useState<HTMLDivElement>();
34+
const [container, setContainer] = useState<HTMLElement>();
3535
const [iframe, setIframe] = useState<HTMLIFrameElement>();
3636
const [scroll, setScroll] = useState(0);
3737
const [height, setHeight] = useState(0);
@@ -53,7 +53,7 @@ export const InteractiveAtomMessenger = ({ id }: Props) => {
5353
}, [id]);
5454

5555
useEffect(() => {
56-
if (!(iframe?.parentElement instanceof HTMLDivElement)) return;
56+
if (!iframe?.parentElement) return;
5757

5858
setContainer(iframe.parentElement);
5959
}, [iframe]);

0 commit comments

Comments
 (0)