feat(edges): add interactionWidth option #1580 #1114

This commit is contained in:
moklick
2022-09-07 17:43:36 +02:00
parent 7a96817114
commit 51e957e5db
10 changed files with 62 additions and 61 deletions
@@ -1,9 +1,14 @@
import { memo } from 'react';
import { memo, useMemo } from 'react';
import { EdgeSmoothStepProps } from '../../types';
import { SmoothStepEdgeProps } from '../../types';
import SmoothStepEdge from './SmoothStepEdge';
const StepEdge = memo((props: EdgeSmoothStepProps) => <SmoothStepEdge {...props} borderRadius={0} />);
const StepEdge = memo((props: SmoothStepEdgeProps) => (
<SmoothStepEdge
{...props}
pathOptions={useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset])}
/>
));
StepEdge.displayName = 'StepEdge';