diff options
Diffstat (limited to 'demos/hello-next/bun-framework-next/server.development.tsx')
-rw-r--r-- | demos/hello-next/bun-framework-next/server.development.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/demos/hello-next/bun-framework-next/server.development.tsx b/demos/hello-next/bun-framework-next/server.development.tsx index 54181c271..82caf0ab7 100644 --- a/demos/hello-next/bun-framework-next/server.development.tsx +++ b/demos/hello-next/bun-framework-next/server.development.tsx @@ -1,3 +1,19 @@ +import React from "react"; +class URL { + constructor(base, source) { + this.pathname = source; + this.href = base + source; + } +} +var onlyChildPolyfill = React.Children.only; +React.Children.only = function (children) { + if (children && typeof children === "object" && children.length == 1) { + return onlyChildPolyfill(children[0]); + } + + return onlyChildPolyfill(children); +}; +globalThis.URL = URL; globalThis.global = globalThis; import { render } from "./renderDocument"; |