Merge pull request #5415 from xyflow/chore/marker-types

chore(types): less strict marker type #5411
This commit is contained in:
Moritz Klack
2025-07-28 10:52:36 +02:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@xyflow/react': patch
'@xyflow/system': patch
---
Allow strings and enums for existing marker types
@@ -40,7 +40,7 @@ export const MarkerSymbols = {
[MarkerType.ArrowClosed]: ArrowClosedSymbol,
};
export function useMarkerSymbol(type: MarkerType) {
export function useMarkerSymbol(type: MarkerType | `${MarkerType}`) {
const store = useStoreApi();
const symbol = useMemo(() => {
+1 -1
View File
@@ -90,7 +90,7 @@ export enum ConnectionLineType {
* @public
*/
export type EdgeMarker = {
type: MarkerType;
type: MarkerType | `${MarkerType}`;
color?: string;
width?: number;
height?: number;