chore(types): enforce defaultProps inside react flow component

This commit is contained in:
Christopher Möller
2021-11-18 18:01:20 +01:00
parent 004dcc6528
commit 9d159c1e87
7 changed files with 31 additions and 23 deletions
+6 -2
View File
@@ -20,6 +20,9 @@ export interface GraphViewProps extends Omit<ReactFlowProps, 'onSelectionChange'
defaultPosition: [number, number];
defaultMarkerColor: string;
selectNodesOnDrag: boolean;
noDragClassName: string;
noWheelClassName: string;
noPanClassName: string;
}
const GraphView = ({
@@ -77,7 +80,7 @@ const GraphView = ({
onEdgeUpdateStart,
onEdgeUpdateEnd,
noDragClassName,
noZoomClassName,
noWheelClassName,
noPanClassName,
}: GraphViewProps) => {
useOnLoadHandler(onLoad);
@@ -110,7 +113,7 @@ const GraphView = ({
onSelectionContextMenu={onSelectionContextMenu}
preventScrolling={preventScrolling}
noDragClassName={noDragClassName}
noZoomClassName={noZoomClassName}
noWheelClassName={noWheelClassName}
noPanClassName={noPanClassName}
>
<Viewport>
@@ -147,6 +150,7 @@ const GraphView = ({
selectNodesOnDrag={selectNodesOnDrag}
onlyRenderVisibleElements={onlyRenderVisibleElements}
noPanClassName={noPanClassName}
noDragClassName={noDragClassName}
/>
</Viewport>
</FlowRenderer>