iframe-resizer-react icon indicating copy to clipboard operation
iframe-resizer-react copied to clipboard

onMessage handler not getting any data in IframeResizer in reactjs

Open avinashakula opened this issue 3 years ago • 0 comments

import React, {useEffect, useRef, useState} from "react";
import IframeResizer from 'iframe-resizer-react'


export default()=>{
const ref = useRef(null);
const [message, setMessage] = useState("default");
const onMessage = (msg)=>{ 
   // Not able to receive any data
   setMessage(msg)
}

return <>
    <IframeResizer
        forwardRef={ref}
        log
        src="link"
        onMessage={onMessage}
    />
    <p>{message}</p>
</>
}
The source link is simple webpage that return data if we clicked on button located in it. Suggestions/solutions are highly appreciable.

avinashakula avatar Aug 05 '22 11:08 avinashakula