UNPKG

mini-react-dom

Version:

A lightweight React-like DOM renderer with JSX, hooks, context, SSR and lazy support

16 lines (15 loc) 365 B
export function Suspense({ fallback, children }) { try { return children; } catch (promise) { if (typeof window !== "undefined") { promise.then(() => { requestIdleCallback(() => { document.getElementById("root").innerHTML = ""; render(rootElement, rootContainer); }); }); } return fallback; } }