fix(react) added internal edge components, to make id, source, handle optional on exported edges

This commit is contained in:
Peter
2023-11-28 14:30:26 +01:00
parent 43c78d6c11
commit 2e15fd72ee
13 changed files with 331 additions and 11 deletions
@@ -1,9 +1,10 @@
import { memo, useMemo } from 'react';
import { Optional } from '@xyflow/system';
import SmoothStepEdge from './SmoothStepEdge';
import type { SmoothStepEdgeProps } from '../../types';
const StepEdge = memo((props: SmoothStepEdgeProps) => (
const StepEdge = memo((props: Optional<SmoothStepEdgeProps, 'id' | 'source' | 'target'>) => (
<SmoothStepEdge
{...props}
pathOptions={useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset])}