diff --git a/src/iframe.tsx b/src/iframe.tsx index 892bf4f..248fabc 100644 --- a/src/iframe.tsx +++ b/src/iframe.tsx @@ -15,6 +15,7 @@ const Iframe: ComponentType = ({ onLoad, onMouseOver, onMouseOut, + onError, scrolling, id, frameBorder, @@ -63,6 +64,7 @@ const Iframe: ComponentType = ({ onLoad: onLoad || null, onMouseOver: onMouseOver || null, onMouseOut: onMouseOut || null, + onError: onError || null, key: key || "iframe" }) let props = Object.create(null) diff --git a/src/types.d.ts b/src/types.d.ts index eda5e1c..ec1e87b 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -1,3 +1,4 @@ +import type React from 'react'; type SandboxAttributeValue = "allow-downloads-without-user-activation" | "allow-forms" | "allow-modals" | "allow-orientation-lock" | "allow-pointer-lock" | "allow-popups" | "allow-popups-to-escape-sandbox" | "allow-presentation" | "allow-same-origin" | "allow-scripts" | "allow-storage-access-by-user-activation" | "allow-top-navigation" | "allow-top-navigation-by-user-activation"; export interface IIframe { @@ -19,6 +20,7 @@ export interface IIframe { onLoad?: () => void, onMouseOver?: () => void, onMouseOut?: () => void, + onError?: (event: React.SyntheticEvent) => void, frameBorder?: number, scrolling?: "auto" | "yes" | "no", id?: string,