From 8b2c4a38a461ff5ecc95972291bc711e2c5dec9a Mon Sep 17 00:00:00 2001
From: 简律纯 <hsiangnianian@outlook.com>
Date: Fri, 28 Apr 2023 01:47:57 +0800
Subject:

---
 .../kitchen-sink/apps/blog/app/entry.client.tsx    | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 examples/kitchen-sink/apps/blog/app/entry.client.tsx

(limited to 'examples/kitchen-sink/apps/blog/app/entry.client.tsx')

diff --git a/examples/kitchen-sink/apps/blog/app/entry.client.tsx b/examples/kitchen-sink/apps/blog/app/entry.client.tsx
new file mode 100644
index 0000000..8338545
--- /dev/null
+++ b/examples/kitchen-sink/apps/blog/app/entry.client.tsx
@@ -0,0 +1,22 @@
+import { RemixBrowser } from "@remix-run/react";
+import { startTransition, StrictMode } from "react";
+import { hydrateRoot } from "react-dom/client";
+
+function hydrate() {
+  startTransition(() => {
+    hydrateRoot(
+      document,
+      <StrictMode>
+        <RemixBrowser />
+      </StrictMode>
+    );
+  });
+}
+
+if (typeof requestIdleCallback === "function") {
+  requestIdleCallback(hydrate);
+} else {
+  // Safari doesn't support requestIdleCallback
+  // https://caniuse.com/requestidlecallback
+  setTimeout(hydrate, 1);
+}
-- 
cgit v1.2.3-70-g09d2

