mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-10-30 08:37:56 +09:00
We do not use sentry 1 year (since 5 april 2023). Better get rid of for now to not block updates.
26 lines
786 B
TypeScript
26 lines
786 B
TypeScript
import { RemixBrowser } from "@remix-run/react";
|
|
import { startTransition, StrictMode } from "react";
|
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
|
|
startTransition(() => {
|
|
if (document.documentElement.dataset.builder === "true") {
|
|
hydrateRoot(
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
document.getElementById("root")!,
|
|
<StrictMode>
|
|
<RemixBrowser />
|
|
</StrictMode>
|
|
);
|
|
return;
|
|
}
|
|
|
|
// Do not hydrate canvas, to avoid hydration Errors in case of 3rd party plugins.
|
|
// Just render it from scratch. (We don't have data on the Canvas at the server so no FOUC is possible)
|
|
const root = createRoot(document as never);
|
|
root.render(
|
|
<StrictMode>
|
|
<RemixBrowser />
|
|
</StrictMode>
|
|
);
|
|
});
|