Sfoglia il codice sorgente

fix(ui): guard Node reference for SSR compatibility in isTriggerTitle (#5509)

YeonGyu-Kim 2 mesi fa
parent
commit
210b3e905b
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      packages/ui/src/components/basic-tool.tsx

+ 3 - 1
packages/ui/src/components/basic-tool.tsx

@@ -13,7 +13,9 @@ export type TriggerTitle = {
 }
 
 const isTriggerTitle = (val: any): val is TriggerTitle => {
-  return typeof val === "object" && val !== null && "title" in val && !(val instanceof Node)
+  return (
+    typeof val === "object" && val !== null && "title" in val && (typeof Node === "undefined" || !(val instanceof Node))
+  )
 }
 
 export interface BasicToolProps {