From 163e78813ee2c129e753f2033abce5da26d41ebe Mon Sep 17 00:00:00 2001 From: Froidefond Julien Date: Thu, 26 Mar 2026 08:37:22 +0100 Subject: [PATCH] fix: cache getServerSnapshot return value to prevent useSyncExternalStore infinite loop Co-Authored-By: Claude Sonnet 4.6 --- apps/backoffice/app/components/ui/Toast.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/backoffice/app/components/ui/Toast.tsx b/apps/backoffice/app/components/ui/Toast.tsx index ab1602c..cdca6ff 100644 --- a/apps/backoffice/app/components/ui/Toast.tsx +++ b/apps/backoffice/app/components/ui/Toast.tsx @@ -44,8 +44,9 @@ function getSnapshot() { return toasts; } +const EMPTY_TOASTS: ToastItem[] = []; function getServerSnapshot(): ToastItem[] { - return []; + return EMPTY_TOASTS; } export function toast(message: string, variant?: ToastVariant) {