diff --git a/src/components/Playground/Output/Preview/Render.tsx b/src/components/Playground/Output/Preview/Render.tsx index ac37647..a09dfaa 100644 --- a/src/components/Playground/Output/Preview/Render.tsx +++ b/src/components/Playground/Output/Preview/Render.tsx @@ -58,15 +58,16 @@ const Render = ({ iframeKey, compiledCode, mobileMode = false }: RenderProps) => } useEffect(() => { - if (isLoaded) { - iframeRef.current?.contentWindow?.postMessage( - { - type: 'UPDATE', - data: { compiledCode } - } as IMessage, - '*' - ) + if (!isLoaded) { + return } + iframeRef.current?.contentWindow?.postMessage( + { + type: 'UPDATE', + data: { compiledCode } + } as IMessage, + '*' + ) }, [isLoaded, compiledCode]) return mobileMode ? ( diff --git a/src/components/Playground/Output/Preview/Simulation.tsx b/src/components/Playground/Output/Preview/Simulation.tsx index 3e41137..1164644 100644 --- a/src/components/Playground/Output/Preview/Simulation.tsx +++ b/src/components/Playground/Output/Preview/Simulation.tsx @@ -38,7 +38,7 @@ const Simulation = ({ data }: NodeProps) => { ref={data.iframeRef} src={data.iframeUrl} onLoad={() => data.setIsLoaded(true)} - sandbox="allow-downloads allow-forms allow-modals allow-scripts" + sandbox={'allow-downloads allow-forms allow-modals allow-scripts'} allow={'clipboard-read; clipboard-write'} />