fix useNodesData returning undefined in svelte flow

This commit is contained in:
peterkogo
2024-10-08 11:41:25 +02:00
parent eb71e34d44
commit fba54e669d
3 changed files with 6 additions and 4 deletions
@@ -21,7 +21,7 @@ export type UppercaseNode = Node<{ text: string }, 'uppercase'>;
export type MyNode = TextNode | ResultNode | UppercaseNode;
export function isTextNode(node: any): node is TextNode | UppercaseNode {
return node.type === 'text' || node.type === 'uppercase';
return !node || !node.type ? false : node.type === 'text' || node.type === 'uppercase';
}
const nodeTypes = {