fix(react) added internal edge components, to make id, source, handle optional on exported edges
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { memo } from 'react';
|
||||
import { Position, getBezierEdgeCenter } from '@xyflow/system';
|
||||
import { type Optional, Position, getBezierEdgeCenter } from '@xyflow/system';
|
||||
|
||||
import BaseEdge from './BaseEdge';
|
||||
import type { EdgeProps } from '../../types';
|
||||
@@ -73,6 +73,7 @@ export function getSimpleBezierPath({
|
||||
|
||||
const SimpleBezierEdge = memo(
|
||||
({
|
||||
id,
|
||||
sourceX,
|
||||
sourceY,
|
||||
targetX,
|
||||
@@ -89,7 +90,7 @@ const SimpleBezierEdge = memo(
|
||||
markerEnd,
|
||||
markerStart,
|
||||
interactionWidth,
|
||||
}: EdgeProps) => {
|
||||
}: Optional<EdgeProps, 'id' | 'source' | 'target'>) => {
|
||||
const [path, labelX, labelY] = getSimpleBezierPath({
|
||||
sourceX,
|
||||
sourceY,
|
||||
@@ -101,6 +102,7 @@ const SimpleBezierEdge = memo(
|
||||
|
||||
return (
|
||||
<BaseEdge
|
||||
id={id}
|
||||
path={path}
|
||||
labelX={labelX}
|
||||
labelY={labelY}
|
||||
|
||||
Reference in New Issue
Block a user