fix(tests) adjusted FlowConfig type
This commit is contained in:
Vendored
+5
-5
@@ -2,10 +2,10 @@ import { BackgroundProps, ControlProps, Edge, MiniMapProps, Node, PanelProps, Re
|
||||
|
||||
declare global {
|
||||
interface FlowConfig {
|
||||
flowProps: Omit<ReactFlowProps, 'nodes' | 'edges'> & { nodes: Node[]; edges: Edge[] };
|
||||
panelProps: PanelProps;
|
||||
backgroundProps: BackgroundProps;
|
||||
controlsProps: ControlProps;
|
||||
minimapProps: MiniMapProps;
|
||||
flowProps?: Omit<ReactFlowProps, 'nodes' | 'edges'> & { nodes: Node[]; edges: Edge[] };
|
||||
panelProps?: PanelProps;
|
||||
backgroundProps?: BackgroundProps;
|
||||
controlsProps?: ControlProps;
|
||||
minimapProps?: MiniMapProps;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ type FlowProps = {
|
||||
};
|
||||
|
||||
export default ({ flowConfig }: FlowProps) => {
|
||||
const [nodes, setNodes] = useState(flowConfig.flowProps.nodes);
|
||||
const [edges, setEdges] = useState(flowConfig.flowProps.edges);
|
||||
const [nodes, setNodes] = useState(flowConfig.flowProps?.nodes);
|
||||
const [edges, setEdges] = useState(flowConfig.flowProps?.edges);
|
||||
const props = { ...flowConfig.flowProps, nodes, edges };
|
||||
|
||||
const onNodesChange: OnNodesChange = useCallback((changes) => setNodes((nds) => applyNodeChanges(changes, nds)), []);
|
||||
|
||||
Reference in New Issue
Block a user