fix: cache getServerSnapshot return value to prevent useSyncExternalStore infinite loop
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,8 +44,9 @@ function getSnapshot() {
|
|||||||
return toasts;
|
return toasts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const EMPTY_TOASTS: ToastItem[] = [];
|
||||||
function getServerSnapshot(): ToastItem[] {
|
function getServerSnapshot(): ToastItem[] {
|
||||||
return [];
|
return EMPTY_TOASTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toast(message: string, variant?: ToastVariant) {
|
export function toast(message: string, variant?: ToastVariant) {
|
||||||
|
|||||||
Reference in New Issue
Block a user