Files
webstudio/apps/builder/app/entry.client.tsx
T
Bogdan Chadkin eb5e9200d9 refactor: drop unused sentry (#3100)
We do not use sentry 1 year (since 5 april 2023).
Better get rid of for now to not block updates.
2024-04-05 23:21:45 +07:00

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>
);
});