From 835f2e2c5b45d08a3cacbb5cae3d5dad67eb58f6 Mon Sep 17 00:00:00 2001 From: Baraky Date: Mon, 31 Jul 2023 14:55:56 -0300 Subject: [PATCH] feat: making error callback available --- src/iframe.tsx | 2 ++ src/types.d.ts | 2 ++ 2 files changed, 4 insertions(+) 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,