Open Mrcxt opened 8 months ago
@Mrcxt
import React, { useEffect, useState, Fragment } from 'react';
import IFrame, { useFrame } from '@uiw/react-iframe';
const InnerComponent = () => {
// Hook returns iframe's window and document instances from Frame context
const { document, window } = useFrame();
return (
<div>
<div>Hello World!</div>
</div>
);
};
export default function Demo() {
const onLoad = (evn) => {
console.log("iframe loaded successfully!", evn)
}
return (
<IFrame onLoad={onLoad}>
<InnerComponent />
</IFrame>
);
}
I need to do something after the iframe has finished loading, and I need to use callback functions.