aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-framework-next/server-polyfills.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/bun-framework-next/server-polyfills.tsx')
-rw-r--r--packages/bun-framework-next/server-polyfills.tsx2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/bun-framework-next/server-polyfills.tsx b/packages/bun-framework-next/server-polyfills.tsx
index 474ee6ec9..d34c08fc5 100644
--- a/packages/bun-framework-next/server-polyfills.tsx
+++ b/packages/bun-framework-next/server-polyfills.tsx
@@ -13,6 +13,7 @@ class URL {
}
}
var onlyChildPolyfill = React.Children.only;
+
React.Children.only = function (children) {
if (children && typeof children === "object" && children.length == 1) {
return onlyChildPolyfill(children[0]);
@@ -20,6 +21,7 @@ React.Children.only = function (children) {
return onlyChildPolyfill(children);
};
+
globalThis.URL = URL;
import { TextEncoder, TextDecoder } from "./text-encoder-polyfill";