refactor defaultNodes/defaultEdges handling (#3882)

* refactor(react): cleanup defaultnodes/defaultedges handling

* chore(examples): cleanup

* chore(examples): cleanup

* fix(react): selection for uncontrolled flows
This commit is contained in:
Moritz Klack
2024-02-07 17:09:39 +01:00
committed by GitHub
parent 76606c67da
commit 6b18c9daeb
10 changed files with 96 additions and 172 deletions
@@ -8,6 +8,8 @@ export function Wrapper({
children,
nodes,
edges,
defaultNodes,
defaultEdges,
width,
height,
fitView,
@@ -15,6 +17,8 @@ export function Wrapper({
children: ReactNode;
nodes?: Node[];
edges?: Edge[];
defaultNodes?: Node[];
defaultEdges?: Edge[];
width?: number;
height?: number;
fitView?: boolean;
@@ -31,6 +35,8 @@ export function Wrapper({
<ReactFlowProvider
initialNodes={nodes}
initialEdges={edges}
defaultNodes={defaultNodes}
defaultEdges={defaultEdges}
initialWidth={width}
initialHeight={height}
fitView={fitView}