@@ -222,6 +259,18 @@ function ImageEditorInner(
// flex first: a default the consumer's style can override.
style={{ flex: 1, ...style }}
/>
+ {fallback && (
+
+ {fallback}
+
+ )}
);
}
diff --git a/src/loadScript.ts b/src/loadScript.ts
index 8cceb77..def0ce0 100644
--- a/src/loadScript.ts
+++ b/src/loadScript.ts
@@ -1,9 +1,9 @@
const defaultScriptUrl = 'https://cdn.unlayer.com/image-editor/embed.js';
-// When reusing a host-injected tag we cannot know whether it already fired
-// `error` (a dead tag never re-fires), so the wait is bounded instead of
-// letting the promise hang forever.
-const REUSED_TAG_TIMEOUT_MS = 30_000;
+// A script request can stall indefinitely (for example, when a network
+// middlebox drops the CDN request) without dispatching `load` or `error`.
+// Bound every wait so consumers can render an error state and retry.
+const SCRIPT_LOAD_TIMEOUT_MS = 30_000;
interface TrackedLoad {
promise: Promise