Skip to content

Commit

Permalink
migrate edge default props (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiTsybulskyi authored Dec 20, 2024
1 parent d5768c1 commit 7f329c2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/symbols/Edge/Edge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface EdgeProps {
onAdd?: (event: React.MouseEvent<SVGGElement, MouseEvent>, edge: EdgeData) => void;
}

export const Edge: FC<Partial<EdgeProps>> = ({ sections, interpolation, properties, labels, className, containerClassName, disabled, removable = true, selectable = true, upsertable = true, style, children, add = <Add />, remove = <Remove />, label = <Label />, onClick = () => undefined, onKeyDown = () => undefined, onEnter = () => undefined, onLeave = () => undefined, onRemove = () => undefined, onAdd = () => undefined }) => {
export const Edge: FC<Partial<EdgeProps>> = ({ sections, interpolation = 'curved', properties, labels, className, containerClassName, disabled, removable = true, selectable = true, upsertable = true, style, children, add = <Add />, remove = <Remove />, label = <Label />, onClick = () => undefined, onKeyDown = () => undefined, onEnter = () => undefined, onLeave = () => undefined, onRemove = () => undefined, onAdd = () => undefined }) => {
const pathRef = useRef<SVGPathElement | null>(null);
const [deleteHovered, setDeleteHovered] = useState<boolean>(false);
const [center, setCenter] = useState<CenterCoords | null>(null);
Expand Down Expand Up @@ -193,7 +193,3 @@ export const Edge: FC<Partial<EdgeProps>> = ({ sections, interpolation, properti
</g>
);
};

Edge.defaultProps = {
interpolation: 'curved'
};

0 comments on commit 7f329c2

Please sign in to comment.