소스 검색

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

YeonGyu-Kim 8 달 전
부모
커밋
210b3e905b
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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 => {
 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 {
 export interface BasicToolProps {