Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion frontend/preview/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ function initPreview() {
globalStore.set(getAtoms().fullConfigAtom, {} as FullConfigType);
GlobalModel.getInstance().initialize(initOpts);
loadFonts();
const root = createRoot(document.getElementById("main")!);
const container = document.getElementById("main")!;
let root = (container as any).__reactRoot;
if (!root) {
root = createRoot(container);
(container as any).__reactRoot = root;
}
root.render(<PreviewRoot />);
}

Expand Down
3 changes: 3 additions & 0 deletions frontend/preview/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export default defineConfig({
react(),
tailwindcss(),
],
build: {
minify: false,
},
server: {
port: 7007,
},
Expand Down
Loading