Merge pull request #5420 from ShlomoGalle/chore/fix-node-domattributes-type

chore(types): omit defaultValue from Node domAttributes to fix Redux typing issue #5418
This commit is contained in:
Moritz Klack
2025-07-29 13:45:38 +02:00
committed by GitHub
5 changed files with 20 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@xyflow/react': patch
'@xyflow/svelte': patch
---
Omit `defaultValue` from `Node`'s and `Edge`'s `domAttributes` to fix type incompatibility when using `WritableDraft`
+4 -1
View File
@@ -72,7 +72,10 @@ export type Edge<
/** /**
* General escape hatch for adding custom attributes to the edge's DOM element. * General escape hatch for adding custom attributes to the edge's DOM element.
*/ */
domAttributes?: Omit<SVGAttributes<SVGGElement>, 'id' | 'style' | 'className' | 'role' | 'aria-label'>; domAttributes?: Omit<
SVGAttributes<SVGGElement>,
'id' | 'style' | 'className' | 'role' | 'aria-label' | 'defaultValue'
>;
}; };
type SmoothStepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge< type SmoothStepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<
+8 -1
View File
@@ -29,7 +29,14 @@ export type Node<
*/ */
domAttributes?: Omit< domAttributes?: Omit<
HTMLAttributes<HTMLDivElement>, HTMLAttributes<HTMLDivElement>,
'id' | 'style' | 'className' | 'draggable' | 'role' | 'aria-label' | keyof DOMAttributes<HTMLDivElement> | 'id'
| 'style'
| 'className'
| 'draggable'
| 'role'
| 'aria-label'
| 'defaultValue'
| keyof DOMAttributes<HTMLDivElement>
>; >;
}; };
+1 -1
View File
@@ -35,7 +35,7 @@ export type Edge<
*/ */
domAttributes?: Omit< domAttributes?: Omit<
SVGAttributes<SVGGElement>, SVGAttributes<SVGGElement>,
'id' | 'style' | 'class' | 'role' | 'aria-label' 'id' | 'style' | 'class' | 'role' | 'aria-label' | 'defaultValue'
>; >;
}; };
+1
View File
@@ -38,6 +38,7 @@ export type Node<
| 'draggable' | 'draggable'
| 'role' | 'role'
| 'aria-label' | 'aria-label'
| 'defaultValue'
| keyof DOMAttributes<HTMLDivElement> | keyof DOMAttributes<HTMLDivElement>
>; >;
}; };