feat: enhance layout and error handling in canvas component

- Added suppressHydrationWarning to RootLayout for improved hydration handling.
- Updated error logging in CanvasInner to use more descriptive parameters, enhancing debugging capabilities.
This commit is contained in:
Matthias
2026-03-31 15:39:06 +02:00
parent 73bdf56f72
commit 3ac8857025
2 changed files with 3 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ export default async function RootLayout({
return ( return (
<html <html
lang="de" lang="de"
suppressHydrationWarning
className={cn("h-full", "antialiased", "font-sans", manrope.variable)} className={cn("h-full", "antialiased", "font-sans", manrope.variable)}
> >
<head> <head>

View File

@@ -1836,9 +1836,9 @@ function CanvasInner({ canvasId }: CanvasInnerProps) {
setEdges((eds) => applyEdgeChanges(changes, eds)); setEdges((eds) => applyEdgeChanges(changes, eds));
}, []); }, []);
const onFlowError = useCallback((code: string, message: string) => { const onFlowError = useCallback((id: string, error: string) => {
if (process.env.NODE_ENV === "production") return; if (process.env.NODE_ENV === "production") return;
console.error("[ReactFlow error]", { canvasId, code, message }); console.error("[ReactFlow error]", { canvasId, id, error });
}, [canvasId]); }, [canvasId]);
// ─── Delete Edge on Drop ────────────────────────────────────── // ─── Delete Edge on Drop ──────────────────────────────────────