mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
549 B
TypeScript
24 lines
549 B
TypeScript
import { RemixBrowser } from '@remix-run/react';
|
|
import React from '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);
|
|
}
|