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:
@@ -34,6 +34,7 @@ export default async function RootLayout({
|
||||
return (
|
||||
<html
|
||||
lang="de"
|
||||
suppressHydrationWarning
|
||||
className={cn("h-full", "antialiased", "font-sans", manrope.variable)}
|
||||
>
|
||||
<head>
|
||||
|
||||
@@ -1836,9 +1836,9 @@ function CanvasInner({ canvasId }: CanvasInnerProps) {
|
||||
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;
|
||||
console.error("[ReactFlow error]", { canvasId, code, message });
|
||||
console.error("[ReactFlow error]", { canvasId, id, error });
|
||||
}, [canvasId]);
|
||||
|
||||
// ─── Delete Edge on Drop ──────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user