I am using the latest version of iframe-resizer/react for automatically adjusting the height and width of the iframe.
Whenever I’m reacting the content, I’m getting a runtime error stating –
VM2860:1 Uncaught SyntaxError: Unexpected token ‘s’, “scroll-to-top” is not valid JSON
I don’t know from where this is coming.
I have checked the events that are coming iframe. There also, nothing called scroll-to-top is mentioned.
Below is the code snippet I have written.
Please help me to solve this issue.
import IFrameResizer from "@iframe-resizer/react";
<IFrameResizer
src={iframeSrc}
license="GPLv3"
className="iframe-dialog"
title="Iframe Dialog"
onLoad={onLoad}
scrolling={false}
forwardRef={iframeRef}
style={{
width: "100%",
border: "none",
opacity: "100",
height: "100vh",
}}
/>
I have tried onResized, onMessage handlers given in iframe-resizer/react to get the message, but still nothing happened.